Hi Ranchers,
I am facing an issue while using response.encodeURL(),
I am using the following statement to add jsessionid to my URL (cookies disabled on the browser).
out.println("<a href=\""+ response.encodeURL("/checkcookie.do") +"\">click here</a>");
from my doPost() method.
as given in HFSJ Page 236.
When I place my cursor over the "click here" link which appears, I see the following link in the status bar.
http://localhost:8080/checkcookie.do and the container is not able to find a matching entry in the web.xml
However, when I replace the statement with the following, the container is able to find the correct
servlet and invoke it.
out.println("<a href=."+ response.encodeURL("/checkcookie.do") + ">click here</a>");
The link for the "click here" text, in this case is
http://localhost:8080/CookieApp/checkcookie.do But, there is one more issue. In the CheckCookie servlet when I do a request.getSession() and invoke the isNew() method on the session object, I get a TRUE instead of FALSE.
Please check this and let me know what I am doing wrong.
Thanks in advance for your support.
Regards,
Sanjeev