What is URL rewriting and how is it used to maintain session information?
When the server decides to establish a session (e.g. upon submission of a log-in form or receipt of a non-URL rewritten page), the server assigns a unique session number (or other identifier) and returns to the client an HTML page where all the HREF tags include this session number. Thus, every time the client selects one of the links, the session number is sent back to the server as part of that HTTP request. The client doesn't need to take any special actions in order to use URL rewriting, but the server must keep track of each session and customize each returned HTML page for that particular session.
Creation and tracking of session information on the server side can be done easily using Java Servlets or JSPs using the APIs provided. See the FAQs for those topics for more details.