File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Servlets
Bookmark "Problem with URL rewriting?" Watch "Problem with URL rewriting?" New topic

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.

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
I agree. Here's the link:
subject: Problem with URL rewriting?
jQuery in Action, 3rd edition