You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Steven Elliott <tt...@mac.com> on 2002/02/06 19:40:16 UTC

getParameterMap() question

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:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: getParameterMap() question

Posted by August Detlefsen <au...@yahoo.com>.
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 <tt...@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:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
> 


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

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Tomcat as an NT service

Posted by Ken Sanderson <ke...@rockies.ca>.
Thanks for the help I recieved early, found out why I couldnt get it to work
with JDK and it would work with JRE. Turns out the software sent the
Enterprise Edition not the Standard Edition which has all the bin files I
needed, at any rate, all working. I can now run tomcat using the startup
command.

However, still having problems getting the NT service to work. Originally I
had the service working, just encountered the service shutting down when you
logged out problem. To fix this I upgraded to the new JDK, and now cant
start via the service at all. Its not exactly a complex install process to
get it to work with jk_nt_service.exe so I assume I am missing something
silly :/ I have edited the wrapper.properites to reflect the new jdk
directory, my path's are correct, java_home and tomcat_home both set
properly. Yet every time I try and start the service I get a 1067
termination error both from services window and using net start. Tomcat
works fine if I use the startup command from the tomcat bin, so running out
of options as to what it might be.

Suggestions? Working on NT 4, tomcat3.2.4, JDK 1.3.1.

Thanks,

Ken


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: getParameterMap() question

Posted by Steven Elliott <tt...@mac.com>.
Never mind.  I should know an array when I see one 8ยง.

Apologies for the extra traffic....

Steven


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>