Two Laptop Bag
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes URL Rewriting - Doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "URL Rewriting - Doubt" Watch "URL Rewriting - Doubt" New topic

URL Rewriting - Doubt

kalle suresh
Ranch Hand

Joined: Nov 20, 2007
Posts: 48
In order for session to maintain there should be an unique sessionid that will be passed every time when the user sends the request and server responds back.
In case of cookies : first time the servers creates a session id and set cookie and when the user sends the request, the request will be sent with cookie header;

In case of URL Rewriting : The server appends the session id to the url by doing response.encodeURL(...).

But how the session id will be appended to the request URL?
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

But how the session id will be appended to the request URL?

A request parameter called "jsessionid" will be appended to the url. Here is an example from the servlets specification :

The session ID must be encoded as a path parameter in the URL string. The
name of the parameter must be jsessionid. Here is an example of a URL
containing encoded path information:;jsessionid=1234

[ December 03, 2007: Message edited by: Christophe Verre ]

[My Blog]
All roads lead to JavaRanch
I agree. Here's the link:
subject: URL Rewriting - Doubt
jQuery in Action, 3rd edition