What is the difference between and response.sendRedirect(url) ?
The element forwards the request object containing the client request information from one JSP file to another file. The target file can be an HTML file, another JSP file, or a servlet, as long as it is in the same application context as the forwarding JSP file.
sendRedirect sends HTTP temporary redirect response to the browser, and browser creates a new request to go the redirected page. The response.sendRedirect kills the session variables.
How can you enable session tracking for JSP pages if the browser has disabled cookies: We can enable session tracking using URL rewriting. URL rewriting includes the sessionID within the link itself as a name/value pair. However, for this to be effective, you need to append the session Id for each and every link that is part of your servlet response. adding sessionId to a link is greatly simplified by means of a couple of methods: response.ecnodeURL() associates a session ID with a giver UIRl, and if you are using redirection, response.encodeRedirectURL() can be used by giving the redirected URL as input. Both encodeURL() and encodeRedirectURL() first determine whether cookies are supported by the browser; is so, the input URL is returned unchanged since the session ID wil lbe persisted as cookie.