File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes JSP +HTML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "JSP +HTML" Watch "JSP +HTML" New topic


sanjib jena

Joined: Jun 20, 2001
Posts: 2
Hi all,
Suppose I have two hidden fields with the same name.
How can I access them in the request.getParameter()?
That is in the server side.
(in the client side it can be accessed as it makes an array
automatically as document.formName.hiddenFieldName(i).value)
Andri G

Joined: Oct 15, 2000
Posts: 4
Try request.getParameterValues(String paramName)
Julio Lopez

Joined: Nov 14, 2000
Posts: 28
Try this,
java.lang.String currentValue;
java.lang.String[] parameterValues;
parameterValues = request.getParameterValues(parameterName);
Then to extract the values,
for (int i=0; i < parameterValues.length; i++) {
currentValue = parameterValues[i]; whatever
Hope this help,
Julio Lopez
M-Group Systems
sanjib jena

Joined: Jun 20, 2001
Posts: 2
Thanks a lot Julio,
This is what I looked for
It is sorta covered in the JavaRanch Style Guide.
subject: JSP +HTML
It's not a secret anymore!