File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes working of encodeURL() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "working of encodeURL()" Watch "working of encodeURL()" New topic

working of encodeURL()

Monalisa Das

Joined: May 05, 2013
Posts: 11
when does response.encodeURL() works i.e when it will append jsessionid at the end of url and when it will simply return the url
shiva pandey

Joined: Jan 24, 2011
Posts: 10
At the first request from client ,container starts new session and sends the response with both a 'set cookie' header for the session id and the session id appended to the urls(if response.encodeURL() is being used).
Now suppose next request comes from this client, it will have the session id appended to the request url ,but if client accepts cookies, the request will also have a session id cookie.when container knows that client accept cookies,it ignores the response.encodeURL() calls and sends a cookie in response.
I agree. Here's the link:
subject: working of encodeURL()
It's not a secret anymore!