posted 18 years ago
The JSessionId isn't generated by Struts. It's generated by your application server. Generally, an application server will use cookies to determine which HttpSession a user belongs to.
Cookies are not 100% reliable, though, because they can be turned off on the browser. To cover this possibility, the application server can append the session id with every link and use it to determine the session.
This is called URL Rewriting, and it's done by passing the URL to the encodeURL method on the HttpServletResponse object. This causes the application server to append the JsessionId to the URL. If you're using Struts tags exclusively, you don't have to worry about URL rewriting because struts calls the encodeURL method for every link and action. However, if cookies are enabled on your browser, it's the cookie and not the JsessionId that's being used to attach you to a session.