Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

use html:link pass two param

 
javen fang
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a bean list that have two property id / name

And how can I pass the second parameter name after the action next.do??
Thanks.
 
sandy gupta
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you need multiple request parameters, make use of a map:
<html:link action="/viewOrder"
name="paramMap">
Some Link
</html:link>
Or:

<html:link action="/viewOrder"
name="someBean"
property="paramMap">
Some Link
</html:link>

Specify the name (and optional property) attributes to select a java.util.Map bean(paramMap) that contains one or more parameter ids and corresponding values.
HTH
Sahil
 
Franck Tranchant
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This method with Map for multiple parameters works fine but you'll have to insert Java in your JSP...
I think that was what Sandy was talking about.
<%
java.util.HashMap params = new java.util.HashMap();
params.put("id", "idValue");
params.put("name", "nameValue");
pageContext.setAttribute("paramsName", params);
%>
<html:link page="next.do" name="paramsName" scope="page"> next action </html:link>
[ November 05, 2003: Message edited by: Franck Tranchant ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic