I have some doubts in URL rewriting.
I have made servlet UrlRewrite.java where I m using encodeURL() and then going to
When clicked on link, I got Hi.jsp page and jsession id appended to the url.
Then I m clicked on link & went to bye.jsp
But this time I didn’t get jsession id as appended to the url.
But when I did getId() ,I got same jsession id as appended with Hi.jsp
My question is when we go from second to third page in spite of using encodeURL() why didn’t we get jsession id as appended to the URL of the third page.
Here is code.
Manish - First time you got Jsession id in your URL but second time not. When first request came to your server, at that point server is not aware of whether you have enabled the cookies or not. So first time, it will send cookies as well as Jsession id. This is why you got Jsession id first time. On second time and onward, server is now capable to know, Cookies are enabled and it is not sending Jsession id in URL. but you can get this value from request object.
This is internal implementation of server to handle session.
Hope it is clear to you now.
Joined: Mar 30, 2011
what if cookies are disabled.
then will it append jsession id with url on second time ?