URL rewriting is one of the session management technique that manages user session by modifying a URL. Here we append a token or identifier to the URL of the next Servlet or the next resource. Usually, this technique is used when information that is to be transferred is not very critical because the URL can be intercepted easily during transfer. We can send parameter name/value pairs as:
URL name1=value1 & name2=value2
A name and a value is separated using an equal = sign, a parameter name/value pair is separated from another parameter using the ampersand(&). When the user clicks the hyperlink, the parameter name/value pairs will be passed to the server.
When the User clicks on the URL having parameters, the request goes to the Web Container with extra bit of information at the end of URL. The Web Container will fetch the extra part of the requested URL and use it for session management. The getParameter() method is used to get the parameter value at the server side. Let's see a demo program for better clarity: