aspose file tools*
The moose likes Struts and the fly likes Attempting to get a parameter from a link Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Attempting to get a parameter from a link" Watch "Attempting to get a parameter from a link" New topic

Attempting to get a parameter from a link

Gustavo Santos
Ranch Hand

Joined: Jan 22, 2009
Posts: 40
Hello there,

I have a JSP that lists some values and turn them into a link, and each link has its own value... but the problem is that I'm attempting to get the value of the link that has been clicked, but unfortunately I get the value of the last link that has been listed on the forEach loop... does anybody know how can I get that value by passing it to either a parameter or an attribute?



Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60078

Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
a kishore
Ranch Hand

Joined: Sep 16, 2009
Posts: 82
Hi Gustavo,

<td bgcolor="#817339" width="15"></td>
<td><html:link href="javascript:;" onclick="$('methodsForm').submit();">All</html:link></td>

may i know why you are using the above section?

David Newton

Joined: Sep 29, 2008
Posts: 12617

What do you mean when you say "each link has its own value"? Each link is the same, and simply submits the form.
It is sorta covered in the JavaRanch Style Guide.
subject: Attempting to get a parameter from a link
Similar Threads
Struts- Error while java.lang.IllegalArgumentException: setAttribute: name parameter cannot be null.
Strange problem when submitting a form
how do i use checkbox as an active/inactive button for a form?
How to hide url: in struts
How to pass JSTL value to javascript function