This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Struts and the fly likes pass values thru html:link Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "pass values thru html:link" Watch "pass values thru html:link" New topic
Author

pass values thru html:link

ashwin deshpande
Greenhorn

Joined: Jun 14, 2004
Posts: 6
hi,

I am trying to pass 1 parameter thru a html:link, this parameter is set in request scope before the jsp is called...in the page i print out the value of request.getParameter("parameterName"); and it shows up correctly...

i want to pass this parameter ahead when the user clicks on the link...

i tried to do this:
<html:link action='repeatSearch?search=<%=request.getParameter("search")%>' > Search Again </html:link>

but i dont think i can get that working...

is there anyway i could use a html:hidden text field and set that value ? i tried to do that, but was unsuccessfull,...i tried to do it with/without using <html:form> element, again no success.....

one other thing, this parameter is not part of the actionForm and i dont want to add it to the actionForm, just for this purpose....

thanks for reading all this...

ashwin


If at first you dont succeed, take the 5th !
Kinjal Sonpal
Ranch Hand

Joined: Jun 06, 2003
Posts: 96
Originally posted by ashwin deshpande:
<html:link action='repeatSearch?search=<%=request.getParameter("search")%>' > Search Again </html:link>
Try this. HTH.

Thanks and regards,
Kinjal Sonpal
ashwin deshpande
Greenhorn

Joined: Jun 14, 2004
Posts: 6
thanks for the info...
will try it out...
right now i am using

<html:link action='myAction'
paramId="id"
paramName="beanName"
paramProperty="id" >
Edit Information ?
</html:link>

and i have a actionform with name beanName in my request scope and a property called 'id'....and its working fine....

dont want to mend it if its not broken...but will try the link elsewhere...

thanks again...

ashwin
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: pass values thru html:link