You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Kieran Buckley (AT/LMI)" <ki...@ericsson.com> on 2004/06/24 12:24:50 UTC

problem passing a param to a servlet

Hi,
I am trying to pass a parameter string of structure , "tic=3,tac-4,toe=8" into a servlet like as follows:

<a href="/myservlet?strgame=tic=3,tac=4,toe=8">
I had this working on a windowns platform before I realised I should have escaped the equals sign some way.Solaris platform tomcat threw a null pointer exception in handling this value for the parameter strhgame.Is there a way for the subsequent equals to be escaped so they can be seen as part of the value?

Thanks,
Kieran

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: problem passing a param to a servlet

Posted by Carsten Lex <c....@deepweb.de>.
Hi Kieran,

use java.net.URLEncoder.encode("tic=3,tac-4,toe=8","UTF-8");
to encode your parameters before writing to HTML

when you receive Parameter then you have to use
java.net.URLDecoder.decode(request.getParameter("strgame"),"UTF-8")

Carsten

Kieran Buckley (AT/LMI) wrote:

>Hi,
>I am trying to pass a parameter string of structure , "tic=3,tac-4,toe=8" into a servlet like as follows:
>
><a href="/myservlet?strgame=tic=3,tac=4,toe=8">
>I had this working on a windowns platform before I realised I should have escaped the equals sign some way.Solaris platform tomcat threw a null pointer exception in handling this value for the parameter strhgame.Is there a way for the subsequent equals to be escaped so they can be seen as part of the value?
>
>Thanks,
>Kieran
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>  
>

-- 

 



Mit freundlichen Grüßen

Dipl.Inform. Carsten Lex
Geschäftsführer 
DeepWeb GmbH

------------------------
DeepWeb GmbH
Universität, Gebäude 30
66123 Saarbrücken

Tel.:  0681 - 302 6308
Mobil: 0163 - 33 37 002



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org