Try to use java.net.URLEncoder. Be careful. JVM that goes with IE4 has a bug
and encodes non-printable characters to '?'. Anyway, see docs
for URLEncoder.

I am not sure how servlet's encodeURL works but I believe that
you should do something like:

"http://myhost/foo/myservlet?param1=" + encodeURL(param1) + "&param2=" + 
encodeURL(param2);

At least, that is how I use URLEncoder.encode( String str )


DD


----------
From:   matteo.manzini[SMTP:[EMAIL PROTECTED]]
Sent:   Monday, October 25, 1999 05:58 PM
To:     [EMAIL PROTECTED]
Subject:        encodeURL part 2

I still have my problems with URL rewriting.
I understand what the HttpServletResponse.encodeURL() is used for, but I can't succed 
in using it inside my servlets.
First of all, I would like to know if JSWDK 1.0 support this method.
If so, I would like to ask u what is the problem in the following line of code:

    out.println("<form action=\"" + 
response.encodeURL("http://localhost:8080/servlet/encUrlServlet.Servlet1") + "\" 
method=\"post\">");

Here, considering what I can understand, if I turn cookies off from my browser, the 
session id should be automatically attached to the url calling encUrlServlet.Servlet1. 
But this doesn't happen, and my session is lost when I try to use it inside doPost 
method of encUrlServlet.Servlet1.
Can someone explain me where is my error?? Or even redirect me to some example code??
Thanks.
Matteo



--
TiscaliFreeNet, libero accesso ad Internet.
http://www.tiscalinet.it

___________________________________________________________________________
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