tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Elliott <ttoi...@mac.com>
Subject Re: getParameterMap() question
Date Wed, 06 Feb 2002 22:18:52 GMT
> From: August Detlefsen <augustd123@yahoo.com>
> Reply-To: augustd@codemagi.com
> Date: Wed, 6 Feb 2002 12:25:25 -0800 (PST)
> To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> 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.

Steven


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message