tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From August Detlefsen <augustd...@yahoo.com>
Subject Re: getParameterMap() question
Date Wed, 06 Feb 2002 20:25:25 GMT
All request parameters are Strings: 

public java.lang.String getParameter(java.lang.String name)

Try casting entry.getValue() to (String):

(String)(entry.getValue())




--- Steven Elliott <ttoille@mac.com> wrote:
> Sorry if this is somewhat offtopic but maybe some experts here can
> help
> clear this up for me.
> 
> I would like to use the ServletRequest.getParameterMap() in a JSP
> page using
> the request object.
> 
> I post a form in the previous page using the POST method and the
> request in
> processed with the following code:
> 
> Map map = request.getParameterMap();
> Iterator itr = map.entrySet().iterator();
> while (itr.hasNext()) {
>     Map.Entry entry = (Map.Entry)itr.next();
>     System.out.println(entry.getKey()+" = "+entry.getValue());
> }
> 
> What gets printout is the following:
> 
> name = [Ljava.lang.String;@5349e2
> surName = [Ljava.lang.String;@17d3f0
> ....etc.
> 
> So the key is correctly output but the value is not?  If I try this
> with
> something like System.getProperties() both the key and value are
> output
> correctly.
> 
> So what is the secret for making this work with the request object?
> 
> TIA
> 
> 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>
> 


__________________________________________________
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

--
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