File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Problem with URL rewriting? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Problem with URL rewriting?" Watch "Problem with URL rewriting?" New topic
Author

Problem with URL rewriting?

Dominic Steng�rd
Ranch Hand

Joined: Feb 05, 2001
Posts: 186
Hey ServletGurus!

Im trying to get my links URL encoded using:



And from what I have understood, the Tomcat server doesnt know if the client will support cookies on the first response back to the client, so it should start by attempting to set the session id in a cookie AND at the end of URLs that have been encoded using the reponse.encodeURL() method on the first response.

This doesnt seem to be happening. When I access my servlet for the first time it doesnt add the session id at the end of the "click me" link.
Why?

Thanks in advance.

Kind regards


Dominic Steng�rd<br />Sun Certified Java 2 Programmer
Michael Ku
Ranch Hand

Joined: Apr 20, 2002
Posts: 510
1) URLEncoding may need to be activated on the server. I know in WebSphere it is a server setting. The same may be true for Tomcat

2) Some servers "know" that cookies are active and will not append the jSessionID to the URL (don't ask me how they know). Turn off cookie and ss if the URL is appended
 
 
subject: Problem with URL rewriting?
 
Similar Threads
"#{...} is not allowed in template text" error
java.lang.IllegalStateException: using sendRedirect()
The AXIS engine could not find a target service to invoke
URL-rewriting
Keeping client in a session with url