[ https://issues.apache.org/jira/browse/WW-4741?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16346835#comment-16346835 ]
Hudson commented on WW-4741: ---------------------------- SUCCESS: Integrated in Jenkins build Struts-master-JDK7 #95 (See [https://builds.apache.org/job/Struts-master-JDK7/95/]) WW-4741 Does not create session if it doesn't exist (lukaszlenart: rev e9a4bcd776e82afb135091f7ad48ada90bf5d2e6) * (edit) core/src/main/java/org/apache/struts2/interceptor/I18nInterceptor.java WW-4741 Improves tests to cover the new logic (lukaszlenart: rev 92e931d169ccd35cf3a8456451a74901979aed76) * (edit) core/src/test/java/org/apache/struts2/interceptor/I18nInterceptorTest.java > Http Sessions forcefully created for all requests using I18nInterceptor with > default Storage value. > --------------------------------------------------------------------------------------------------- > > Key: WW-4741 > URL: https://issues.apache.org/jira/browse/WW-4741 > Project: Struts 2 > Issue Type: Bug > Affects Versions: 2.5.10 > Reporter: Adam Greenfield > Assignee: Lukasz Lenart > Priority: Major > Fix For: 2.5.15 > > > 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 > {noformat}Map<String, Object> session = > invocation.getInvocationContext().getSession(){noformat} > to be null and then calls > {noformat}ServletActionContext.getRequest().getSession(){noformat} > (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 > {noformat}HttpSession httpSession = > ServletActionContext.getRequest().getSession(false); > if(httpSession != null) { > ... // get sessionId and synchronize on it > } > {noformat} -- This message was sent by Atlassian JIRA (v7.6.3#76005)