Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.5.10
-
None
-
None
Description
Changes made in WW-4730 for store and read functions cause an httpSession to be created for every request that uses I18nInterceptor when storage = Storage.SESSION.
Current code checks for
Map<String, Object> session = invocation.getInvocationContext().getSession()
to be null and then calls
ServletActionContext.getRequest().getSession()
(notice how the second one references the HttpServletRequest. The HttpServletRequest Session and and the InvocationContext session are different. The request's session can be null, even if the InvocationContext's session is not).
Calling .getSession() in this manner forcefully creates a session.
An appropriate check here might be
HttpSession httpSession = ServletActionContext.getRequest().getSession(false); if(httpSession != null) { ... // get sessionId and synchronize on it }