File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Specifying Request Parameter in [html:link]" Watch "Specifying Request Parameter in [html:link]" New topic

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="/" >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 ]

Consultant, Sima Solutions
I agree. Here's the link:
subject: Specifying Request Parameter in [html:link]
jQuery in Action, 3rd edition