• Post Reply Bookmark Topic Watch Topic
  • New Topic

Get values from the jsp  RSS feed

 
Praveen K P
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody,
I am having a jsp that contains hidden fields of same name and different values.

<input type="hidden" name="testhidden" value="testhidden0">
<input type="hidden" name="testhidden" value="testhidden1">
<input type="hidden" name="testhidden" value="testhidden2">
<input type="hidden" name="testhidden" value="testhidden3">
<input type="hidden" name="testhidden" value="testhidden4">

Now how do I access these entire fields in my action class? Is there some way to do this?
Iam not making use of struts.

bye
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For accessing a multi-valued parameter, use the HttpServletRequest.getParameterValues() method. It returns the values as a String[].
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Praveen K P",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!