tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Elliott <>
Subject Re: getParameterMap() question
Date Wed, 06 Feb 2002 22:18:52 GMT
> From: August Detlefsen <>
> Reply-To:
> Date: Wed, 6 Feb 2002 12:25:25 -0800 (PST)
> To: Tomcat Users List <>
> Subject: Re: getParameterMap() question
> All request parameters are Strings:
> public java.lang.String getParameter(java.lang.String name)
> Try casting entry.getValue() to (String):
> (String)(entry.getValue())

Actually they are not all Strings and casting them as such will give you the
results I was experiencing.  In the case of getParameterMap() the Map.Entry
VALUE Object is a String[].  This makes sense because even though the Key
value is a Set, there may be more than one value per parameter Key (i.e.
Checkboxes) so to make things work the Value is returned as a String[] in
the guise of an Object(even if only a single value is returned).  Where
there is difficulty is in reading the Javadocs where no reference is made to
the fact that the ServletRequest.getParameterMap() returns a String[] for
the Value element.


To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

View raw message