I have read much about how to access the session from actions and
interceptors, but I still have some confusion about the proper way to do
this so that my session values will be available and replicated properly in
a cluster environment. Specifically, if a user is logged in and making
requests, and then the server they are on goes down, I want their next
request to fail-over to the next server and  have the session identically
available to the framework.

I definitely need access to the session in two key places: In my
authentication Interceptor, which checks if the userObject is in the
session, and in my action classes. I understand that I must get access to
the session differently in an interceptor as opposed to an action. 

 I have seen many ways to do it, including the documentation at:
http://struts.apache.org/2.x/docs/how-do-we-get-access-to-the-session.html.

I am most in need of knowing which method is correct, cluster fail-over
proof - for my interceptor and my action. Can anyone clear this up for me?
These are the methods I have seen so far:

1. ActionContext.getContext().getSession();
2. ActionContext.getSession();
3. invocation.getInvocationContext().getSession();

4. ServletActionContext.getRequest().getSession() 
5. ServletActionContext.getSession() 
6. Implement SessionAware, then use the sessionMap
7. Implement ServletRequestAware: the get the request object, then call
request.getSession()
-- 
View this message in context: 
http://www.nabble.com/Best-way-to-access-Session-with-regards-to-cluster-tp16985836p16985836.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to