Hi there,
I have some confusion on session and request scope, which was not completely answered by existing threads.
When is a better time to store info. in request scope than in session scope? I could not think of any example. It seems that if my web app. wants to be context aware, I always have to use session (besides cookie, URL rewriting).
When does a session expire? Some said that it expires if the client terminates or cookie expires. Is that correct? If I do not use cookie to store session, when will my session expire? Is that defined by a timeout value configurable in the container?
Info. stored in request scope is said to expire whenever responses comes back, if a
JSP A calls another JSP B, any info. stored in request scope by A would still be visible in B, right? However, the next request to A will not be aware of the info. from previous visit, right?
If I do store info. in HttpSession, would that be a problem in a cluster environment where subsequent requests may not be directed to the same server as the intiating server? I thought that the container should automatically handles duplicating session in this case, i.e., I do not have to worry about anything. But I wish to confirm this.
Thanks a lot.
Yan