File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "pass values thru html:link" Watch "pass values thru html:link" New topic

pass values thru html:link

ashwin deshpande

Joined: Jun 14, 2004
Posts: 6

I am trying to pass 1 parameter thru a html:link, this parameter is set in request scope before the jsp is 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...


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

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

<html:link action='myAction'
paramProperty="id" >
Edit Information ?

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...

I agree. Here's the link:
subject: pass values thru html:link
It's not a secret anymore!