Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

s:param struts 2 tag

 
saad rguig
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 :-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic