This week's book giveaway is in the JavaScript forum.
We're giving away four copies of JavaScript Promises Essentials and have Rami Sarieddine on-line!
See this thread for details.
The moose likes Struts and the fly likes Specifying Request Parameter in [html:link] Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Specifying Request Parameter in [html:link]" Watch "Specifying Request Parameter in [html:link]" New topic
Author

Specifying Request Parameter in [html:link]

Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
I want to attach a single parameter with a literal value to html:link. But it seems that I need to create a bean to store the value and give the name of that bean to the paramName attribute. Can we just simply type a literal String value in the html:link tag? It doesn't make sense to go through a big circle in order to do such a simple task?
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
You could simply specify the parameter like this:

<html:link page="/myAction.do?parm1=foo" >click here</html:link>

If you still want to use the other method, it really isn't that hard:

<bean:define id="fooString" value="foo" />
<html:link action="myAction" paramId="parm1" paramName="fooString" >click here</html:link>
[ October 07, 2006: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Specifying Request Parameter in [html:link]