Servlet URL Rewriting

tutorial and example
tutorial and example

This is another approach to maintain the session of a user. In this mechanism, when a client make a request then some extra information is appended in the URL of that request.

This extra information uniquely identifies a user and it may be a path info, parameter attribute etc. Unlike cookies, URL Rewriting will also work when cookies are disabled in our browser.

Example of URL Rewriting

Let’s see an example of URL Rewriting.

Welcome.jsp

DemoURLRewriting.java

Output: