File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes use html:link  pass two param Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "use html:link  pass two param" Watch "use html:link  pass two param" New topic

use html:link pass two param

javen fang

Joined: Jun 29, 2003
Posts: 4
I have a bean list that have two property id / name

And how can I pass the second parameter name after the action

I believe I can fly<br />...................<br /> Just do it !!!
sandy gupta
Ranch Hand

Joined: Jan 30, 2001
Posts: 228
If you need multiple request parameters, make use of a map:
<html:link action="/viewOrder"
Some Link

<html:link action="/viewOrder"
Some 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.

Franck Tranchant
Ranch Hand

Joined: Aug 07, 2003
Posts: 75
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="" name="paramsName" scope="page"> next action </html:link>
[ November 05, 2003: Message edited by: Franck Tranchant ]

I agree. Here's the link:
subject: use html:link pass two param
jQuery in Action, 3rd edition