THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block |
---|
Map attibutes = ActionContext.getContext().getSession(); |
Implement SessionAware
_Preferred_
- Ensure that
servlet-config
Interceptor is included in the Action's stack.The default stack already includes
servlet-config
.
- Edit the Action so that it implements the SessionAware interface.
- The SessionAware interface expects a
setSession
method. You may wish to include a companiongetSession
method.
- The SessionAware interface expects a
- At runtime, call
getSession
to obtain a Map representing the session attributes. - Any changes made to the session Map are reflected in the actual HttpSessionRequest. You may insert and remove session attributes as needed.
...
@see action-default.xml
@see comorg.apache.opensymphonystruts.webworkacton2.interceptor.SessionAware
@see comorg.apache.opensymphonystruts.webworkacton2.interceptor.Servlet Config Interceptor