when i am click the link of ApplicationStatus.jsp in the address bar the url link is showing http://01hw173228:81/help/ApplicationStatus.jsp.
When i submit the request it will go to servelt page in the and the request address bar is showing
To answer this question, I need to ask you another question. Is this your first request in the session ?
Generally, it happens when the cookies are disabled. But, however even if cookies are enabled, first request will need to send jsessionid because the server does not yet know if browser supports cookies or not. Only when the second request comes back with a cookie, the server will realize that client supports cookies.
So, this is expected behavior in the first request ( whether cookies are enabled or not). But, for second request onwards, it depends on whether cookies are enabled.
Please correct me if I am wrong.
SCJP, SCWCD, SCBCD, SCEA - part 1
i need to show the url link in the address bar of the browser.
But here i am not passing any jession id.
Could you please let me know if thier is any method like encodeURL which will hide the jessionid.
Sumanta if you don't want to append the jsessionid to the URL, then don't encode the URL. But as everyone is saying, in that case you will not be able to maintain session of clients who have cookies disabled in their browsers
Encodes the specified URL by including the session ID in it, or, if encoding is not needed, returns the URL unchanged. The implementation of this method includes the logic to determine whether the session ID needs to be encoded in the URL. For example, if the browser supports cookies, or session tracking is turned off, URL encoding is unnecessary.
For robust session tracking, all URLs emitted by a servlet should be run through this method. Otherwise, URL rewriting cannot be used with browsers which do not support cookies.
Parameters: url - the url to be encoded.
Returns: the encoded URL if encoding is needed; the unchanged URL otherwise.