Hi Milt,
Sorry about the ill worded post. After failing to send back multiple
values for the parameter (later found on it was a script error in my hidden
field creation javascript). I was trying to fake mulitple parameters by
setting one param's value to:
"paramvalue¶m=paramvalue¶m=paramvalue"
I was hoping that it would send it as
http://myurl/app/destination?param=paramvalue¶m=paramvalue¶m=paramva
lue
But apparently it's not that simple. :-P hehe
-Tim
-----Original Message-----
From: Milt Epstein [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 13, 2002 5:35 PM
To: [EMAIL PROTECTED]
Subject: Re: Using request.getParameterValues
On Wed, 13 Feb 2002, Chen, Gin wrote:
> Hi all,
> I have a POST form on my page with a hidden param. On submit
> of the page, I want to set this param to have multiple values.
> I have been able to do this with a javascript string concat
> to set the value of it and then from the server side use
> request.getParameter("myhidden") to get the value. But since it has
> multiple values, I find that I have to use StringTokenizers and such
> to get the value from it.
> I would much prefer to use the request.getParameterValues
> method but I dont know how to get the page to send the paramter
> values separately. I've tried to use the param=value¶m=value as
> my string but (of course) that doesnt seem to work.
> Has anyone ever tried to send multiple hidden values to the
> Server without having to use GET equests?
> Is there a better/cleaner way to do this?
Maybe I'm misunderstanding what you're trying to do, but I believe
this all should be handled automatically, regardless of the http
method (i.e. GET or POST). Multiple values for parameters is
perfectly normal stuff, and the built-in API method
(getParameterValues) should handle getting multiple values by default.
Here's the javadoc for that method:
http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/ServletReques
t.html#getParameterValues(java.lang.String)
It returns an array of String's, all the values of the specified
parameter name.
AFAIK, this all has been solved since the very early versions of the
spec.
Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html