URL rewriting points to Remember

URL rewriting adds the session ID to the end of all the URLs in the
HTML that you write to the response.

The session ID then comes back with the request as “extra” info at
the end of the request URL.

URL rewriting will happen automatically if cookies don’t work with
the client, but you have to explicitly encode all of the URLs you
write.

To encode a URL, call response.encodeURL(aString).
out.println(“<a href=’”
+ r esponse.encodeURL(“/BeerTest.do”)
+ “‘>click me</a>”);

There’s no way to get automatic URL rewriting with your static
pages, so if you depend on sessions, you must use dynamically-
generated pages.