> 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.

The encode methods (encodeURL and encodeRedirectURL) are helper
methods that you should use for ALL urls that will be displayed on the
page produced by a servlet or JSP. This includes form action URLs, all
anchor hrefs, images. encodeRedirectURL should be used when redirecting
browsers.

What they do is ensure that session id is added as a get parameter to the
urls
IFF the browser does not accept cookies. Hence the recommendation by Jason
Hunter that the methods be used where session tracking is to be used for
all URL's that you produce. If you don't then things will break when someone
comes to your site with cookie accept switched off (and this is more
frequent than
you might suppose).

I assume that most of the tutorials etc that you have seen seem to brush
over
the subject because it is apparently not really worth discussing however it
was
important enough for such celestial beings as Jason to stress the usage of
these
methods all the time.

Hope this clarifies things

Andy Bailey

___________________________________________________________________________
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