You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Christoph Kukulies <ku...@gilberto.physik.rwth-aachen.de> on 2000/11/27 18:58:27 UTC
passing parameters to a Servlet
I have some strings with blanks that I have to pass to a
Servlet in the URL. How can I do that?
--
Chris Christoph P. U. Kukulies kuku@gil.physik.rwth-aachen.de
Re: passing parameters to a Servlet
Posted by Christoph Kukulies <ku...@gilberto.physik.RWTH-Aachen.DE>.
On Wed, Nov 29, 2000 at 11:09:49AM +0530, Ramesh Kumar . T wrote:
> Encode only your parameter string , using URLEncoder.encode()
>
> ex: jsp/test.jsp?param1=value1¶m2=value2
> encode only the parameters and not the file name
Thanks and thanks to others who pointed me to this
URLEncoder class. It's good to know that :-) - better than fiddling
with strings.
> > servletname¶meter1=this%20and%20 that
> >
> > where a '%20' is a URL encoded space.
> >
> > Hope this helps
> > --
> > Tony Keith
--
Chris Christoph P. U. Kukulies kuku@gil.physik.rwth-aachen.de
Re: passing parameters to a Servlet
Posted by "Ramesh Kumar . T" <ra...@india.adventnet.com>.
Encode only your parameter string , using URLEncoder.encode()
ex: jsp/test.jsp?param1=value1¶m2=value2
encode only the parameters and not the file name
Tony Keith wrote:
> Christoph Kukulies wrote:
>
> > I have some strings with blanks that I have to pass to a
> > Servlet in the URL. How can I do that?
> >
> > --
> > Chris Christoph P. U. Kukulies kuku@gil.physik.rwth-aachen.de
>
> If you are trying to test your servlet by passing information through a
> URL,
> then try the following.
>
> servletname¶meter1=this%20and%20 that
>
> where a '%20' is a URL encoded space.
>
> Hope this helps
> --
> Tony Keith
Re: passing parameters to a Servlet
Posted by Tony Keith <to...@paycom.net>.
Christoph Kukulies wrote:
> I have some strings with blanks that I have to pass to a
> Servlet in the URL. How can I do that?
>
> --
> Chris Christoph P. U. Kukulies kuku@gil.physik.rwth-aachen.de
If you are trying to test your servlet by passing information through a
URL,
then try the following.
servletname¶meter1=this%20and%20 that
where a '%20' is a URL encoded space.
Hope this helps
--
Tony Keith
Re: passing parameters to a Servlet
Posted by Matt Goss <mg...@rtci.com>.
Christoph,
Here you go:
www.myhost.com/myappname/servlet/myservletname?parameter1=value1¶meter2=value2
if the parameters are blank, they should look like this:
parameter1=¶meter2=
hope this helps,
Matt Goss
Christoph Kukulies wrote:
> I have some strings with blanks that I have to pass to a
> Servlet in the URL. How can I do that?
>
> --
> Chris Christoph P. U. Kukulies kuku@gil.physik.rwth-aachen.de