using the following:

String url = http://blah.com/runme?a=b + URLEncoder.encode("&") + "c=7".

or you use the escape string for "&"

liwen
----- Original Message -----
From: "Mike Haberman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, May 13, 2000 10:19 PM
Subject: Re: How can I get parameters with '&' in it ?


> String url = "http://blah.com/runme?a=b&c=7";
> response.encodeUrl(url) doesn't change the input.
>
> any ideas?
>
> thanks again!
>
> mike
>
> by the way I'm running ApacheJServ/1.1  on a freebsd box
>
>
>
>
> On Fri, May 12, 2000 at 10:14:04PM -0500, Chris Murphy wrote:
> > You need to encode the value of the url parameter.
> >
> > Look at the javax.servlet.http.HttpServletResponse.encodeURL(String url)
> > method.
> >
> > NOTE: you only want to encode the values, not the names, of the
parameters.
> > And it's
> > good practice to always do this.
> >
> > Good luck.
> >
> > -----Original Message-----
> > From: Mike Haberman [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, May 12, 2000 8:11 PM
> > To: [EMAIL PROTECTED]
> > Subject: How can I get parameters with '&' in it ?
> >
> >
> > Hello all,
> >
> >    I have a servlet that reads in parameters from a get request.  The
> >    problem is that one of the parameters is a url.  If that url
> >    has an '&' in it, then the parameters are split around it.
> >
> >    for example:
> >
> >    <A HREF =
"mysevlet?name=bob&age=23&url=http://blah.com/runme?a=b&c=7">
> >
> >     in myservlet i get
> >     name:bob
> >     age:23
> >     url:http:..runme?
> >     a:b
> >     c:7
> >
> >     What's the fix so I only get three parameters?
> >
> >     thanks for your time!
> >
> >     [EMAIL PROTECTED]
> >
> >
___________________________________________________________________________
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> > of the message "signoff SERVLET-INTEREST".
> >
> > Archives: http://archives.java.sun.com/archives/servlet-interest.html
> > Resources: http://java.sun.com/products/servlet/external-resources.html
> > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to