[
https://issues.apache.org/jira/browse/WW-3773?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13230957#comment-13230957
]
Kris Coolsaet commented on WW-3773:
-----------------------------------
I am not sufficiently familiar with the inner workings of Struts to comment on
Lukasz' solution (although it looks OK), but in any case I would only execute
this statement if the HTTP session was indeed renewed. Something like
{code}
HttpSession httpSession = ServletActionContext.getRequest().getSession(false);
if (httpSession == null) {
ServletActionContext.getRequest().getSession(true);
ServletActionContext.getContext().setSession(new SessionMap<String,
Object>(ServletActionContext.getRequest()));
}
{code}
> CreateSessionInterceptor and HttpSessionListener do not cooperate well
> ----------------------------------------------------------------------
>
> Key: WW-3773
> URL: https://issues.apache.org/jira/browse/WW-3773
> Project: Struts 2
> Issue Type: Bug
> Components: Core Interceptors
> Affects Versions: 2.3.1.2
> Reporter: Kris Coolsaet
> Assignee: Lukasz Lenart
> Priority: Minor
> Labels: httpsession, interceptors, session
> Fix For: 2.3.2
>
>
> When the current http session has expired, a new http session can be
> automatically created by using a {{CreateSessionInterceptor}}. However, this
> new session is not 'synchronized' with the action context session, i.e., the
> map that is injected into any action that is {{SessionAware}}. This map is
> always empty, however a newly created http session need not necessarily be
> empty, for example when we register a {{HttpSessionListener}} with the web
> application that automatically adds something to the session. (May be useful
> if you want to avoid null checks when retrieving a known object from the
> session.)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira