URL Rewriting

URL Rewriting :

When a request is made, additional parameter is appended with the URL, this is called URL Rewriting. In general added additional parameter will be sessionid or userid. It will suffice to track the session. This type of session tracking doesn’t need any special support from the browser.
Original URL: http://server:port/servlet/ServletName
Rewritten URL: http://server:port/servlet/ServletName?sessionid=191004 .
Disadvantage is, implementing this type of session tracking is tedious. We need to keep track of the parameter as a chain link until the conversation completes and also should make sure that, the parameter doesn’t clash with other application parameters. It will work only with links.

Example :

index.html

Login.java


Servlet2.java

web.xml

 

Leave a Reply

Your email address will not be published. Required fields are marked *