Meaningless Drivel is fun!
The moose likes Servlets and the fly likes How to check if the Servlet URL includes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to check if the Servlet URL includes ";jsessionid=..." ?" Watch "How to check if the Servlet URL includes ";jsessionid=..." ?" New topic

How to check if the Servlet URL includes ";jsessionid=..." ?

Artemesia Lakener
Ranch Hand

Joined: Jun 21, 2005
Posts: 162
Sometimes it is hard to say if the server append the ";jsessionid=..." at the end of URL. Theoretically if you use URL rewriting and client supports cookie, you should not see this in the URL, and if client doesn't support cookie you see this.

However, on the same client setting, I find that sometimes if I hit "refresh" of the first application page and then restart reviewing all the pages, this ";jsessionid=.." disappears.

so, how can I tell from program if the current URL includes this ";jsessionid=.." ?

Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2068
i think, this is what happens,

IF the web application in the server allows url rewriting
...IF first time you talk to the server
......always the server replies with 'both' cookie and url rewriting
......IF server identifies you have cookies enabled
.........he will not do url rewriting anymore
.........he will do url rewriting
......(if you have cookies disabled, then state cant be kept in
..............this manner, unless maybe if u use ssl)...

hope that helps
[ September 10, 2005: Message edited by: Jesus Angeles ]
I agree. Here's the link:
subject: How to check if the Servlet URL includes ";jsessionid=..." ?
jQuery in Action, 3rd edition