On Wed, 13 Oct 1999, Steve Goldberg wrote:
> What can be used to decode a URL?
> I know that when a servlet uses getParameter things are already
> decoded. But suppose your servlet is parsing html and runs across
> encoded URLs.
I'm not sure there is such a decode method, at least, URLEncoder
doesn't have one.
You might take a look at javax.servlet.http.HttpUtils, particularly
the parseQueryString() method, to see if you can make use of it. Else
you may have to "grow your own". That method calls a parseName()
method which actually does the decoding work, but it's private. But
at least you can use it as a model for your own.
> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Milt
> Epstein
> Sent: Wednesday, October 13, 1999 7:08 AM
> To: [EMAIL PROTECTED]
> Subject: Re: encodeURL()
>
> On Wed, 13 Oct 1999, Andy Bailey wrote:
>
> > > Hi,
> > >
> > > encodeURL() encodes the strings in such a way that some
> > > unacceptable characters in the URL are "encoded" to form a new
> > > modified string that can be interperted by the server. So, you
> > > obviously can't use it with <form action=...>.
> >
> > This has already been answered but...
> >
> > The answer above describes an HTMLEncode method which I have been
> > unable to find in any generally available API but is simple enough
> > to write anyway.
> [ ... ]
>
> java.net.URLEncoder.encode()
Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
[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