How can I get stored session values in multiple Struts 2 action classes?
I do not want to use SessionAware
interface in all the actions.
You have three options:
SessionAware
.SessionAware
.ActionContext
:Map attibutes = ActionContext.getContext().getSession();
Documented on the Struts 2 wiki under How do we get access to the session.
Why wouldn't you want to use SessionAware
and make your actions more-easily testable?