On 11/22/05, Max Cooper <[EMAIL PROTECTED]> wrote:
>
> A single instance of each Action class is used to service multiple
> simultaneous requests (just like a Servlet). If you want the session,
> you have to pass it around (or pass the request around, from which you
> can navigate to the session).
>
> Having a no-argument getSession() method on Action would require a
> unique Action instance for each request (or Action instance pooling, or
> thread-local trickery).
Max is correct ... however the alternative would be to implement the method
like this:
protected HttpSession(HttpServletRequest request) {
return request.getSession();
}
Of course, that's so simple that there is not much value add in providing a
helper method for it. Seems simpler just to call request.getSession()
yourself.
-Max
Craig