aspose file tools*
The moose likes Struts and the fly likes s:param struts 2 tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "s:param struts 2 tag" Watch "s:param struts 2 tag" New topic
Author

s:param struts 2 tag

saad rguig
Greenhorn

Joined: Aug 30, 2010
Posts: 1
Am using the 2.2.1 strut 2 version.
when I try to pass some parameters using struts 2: only the first parameter is being passed to the action:
<s:url id="myLink" namespace="/" action="action1" >
<s:param name="id" >
<s:property value="%{server.getId()}" />
</s:param>
<s:param name="contextName" >
<s:property value="contextName" />
</s:param>
</s:url>

so am not getting the contextName
any ideas ??
Pradeep Mittal
Greenhorn

Joined: Feb 23, 2009
Posts: 9
Please add "includeparam" attribute to the URL and specify the name of the params which you want to pasa along with the URL.
Please try the below code.

<s:url id="myLink" namespace="/" action="action1" includeParams="id,contextName" >
<s:param name="id" >
<s:property value="%{server.getId()}" />
</s:param>
<s:param name="contextName" >
<s:property value="contextName" />
</s:param>
</s:url>

Hope this wil help :-)
 
wood burning stoves
 
subject: s:param struts 2 tag