Search code examples
jspstrutseltiles

Passing parameter to jsp via tiles-defs


I'm having a link in a JSP page as shown below

<li><a href="/test.do?version=10.1">download page</a></li>

In struts-config.xml we are forwarding it directly to tiles-defs.xml as shown below

<action path="/test" forward="testDef"/>

in tiles-defs.xml, we are having the entry as shown below

<definition name="testDef" extends="mainDef">
        <put name="__bodyContent" value="/WEB-INF/jsp/ucspt/test.jsp"/>
    </definition>  

test.jsp is the page which is body content of the page.

If you see the first link, I'm sending the version as 10.1. I want to access that version in test.jsp. How to do that.


Solution

  • You can simply use JSP EL expression like

    ${param.version}