Remarks
The true argument of getSession() means that a new session object will be created if one does not already exist.
- For robustness you should probably always use this argument. (The documentation says that the form of getSession() without an argument is equivalent. Experience suggests maybe not?)
This servlet simply outputs a link back to itself (it doesn’t explicitly use the session object).
One important thing to note is the call to encodeURL().
This method should be applied to any URLs in the generated page that refer back to the same servlet context.
This supports URL-rewriting (if this is the session-tracking strategy adopted for the session).