I need to set a
ServletRequest attribute within a Struts2 interceptor (not action class).
ActionContext expose a
Map<String, Object> to control request attributes, like it does for session attributes?
ActionContext implements a map. Is the
ActionContext itself a wrapper for the request attributes?
For code that is not inside an action class (
RequestAware should be used for action classes), Struts2 can expose the servlet request attributes as a Map. They are accessible with:
Map request = (Map) ActionContext.getContext().get("request");
See Strus2 documentation for more details.