Return-Path: X-Original-To: apmail-struts-issues-archive@minotaur.apache.org Delivered-To: apmail-struts-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EE32A11CC8 for ; Wed, 6 Aug 2014 10:55:13 +0000 (UTC) Received: (qmail 22377 invoked by uid 500); 6 Aug 2014 10:55:13 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 22345 invoked by uid 500); 6 Aug 2014 10:55:13 -0000 Mailing-List: contact issues-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list issues@struts.apache.org Received: (qmail 22333 invoked by uid 99); 6 Aug 2014 10:55:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Aug 2014 10:55:13 +0000 Date: Wed, 6 Aug 2014 10:55:13 +0000 (UTC) From: "Lukasz Lenart (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (WW-3415) Issues with Token session interceptor - Blank page is returned in case of double submission MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/WW-3415?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14087524#comment-14087524 ] Lukasz Lenart commented on WW-3415: ----------------------------------- Maybe it is related to WW-3865 and WW-3865 ? Can you test with the latest available version? > Issues with Token session interceptor - Blank page is returned in case of double submission > ------------------------------------------------------------------------------------------- > > Key: WW-3415 > URL: https://issues.apache.org/jira/browse/WW-3415 > Project: Struts 2 > Issue Type: Bug > Components: Core Interceptors > Affects Versions: 2.0.11.1 > Reporter: Sachin Tandon > Fix For: 2.3.18 > > > Blank page is returned in case of double submission. I am using struts version - 2.0.11.1 > I have extendend TokenSessionStoreInterceptor class in my code and not changed any functionality. Following is how my class looks like > public class MyClass extends TokenSessionStoreInterceptor{ > /** > * Default Serial Version Id > */ > private static final long serialVersionUID = 1L; > > protected String handleInvalidToken(ActionInvocation invocation) throws Exception { > ActionContext ac = invocation.getInvocationContext(); > HttpServletRequest request = (HttpServletRequest) ac.get(ServletActionContext.HTTP_REQUEST); > HttpServletResponse response = (HttpServletResponse) ac.get(ServletActionContext.HTTP_RESPONSE); > String tokenName = TokenHelper.getTokenName(); > String token = TokenHelper.getToken(tokenName); > if ((tokenName != null) && (token != null)) { > Map params = ac.getParameters(); > params.remove(tokenName); > params.remove(TokenHelper.TOKEN_NAME_FIELD); > ActionInvocation savedInvocation = InvocationSessionStore.loadInvocation(tokenName, token); > if (savedInvocation != null) { > // set the valuestack to the request scope > ValueStack stack = savedInvocation.getStack(); > Map context = stack.getContext(); > request.setAttribute(ServletActionContext.STRUTS_VALUESTACK_KEY, stack); > ActionContext savedContext = savedInvocation.getInvocationContext(); > savedContext.getContextMap().put(ServletActionContext.HTTP_REQUEST, request); > savedContext.getContextMap().put(ServletActionContext.HTTP_RESPONSE, response); > Result result = savedInvocation.getResult(); > if ((result != null) && (savedInvocation.getProxy().getExecuteResult())) { > synchronized (context) { > result.execute(savedInvocation); > } > } > // turn off execution of this invocations result > invocation.getProxy().setExecuteResult(false); > return savedInvocation.getResultCode(); > } > } > return INVALID_TOKEN_CODE; > } > protected String handleValidToken(ActionInvocation invocation) throws Exception { > // we know the token name and token must be there > String key = TokenHelper.getTokenName(); > String token = TokenHelper.getToken(key); > InvocationSessionStore.storeInvocation(key, token, invocation); > > return invocation.invoke(); > } > } > Now, whenever I do a double submission for a functionality like search (which gets loads of data from the database), previously saved invocation does not complete and savedInvocation.getResultCode() returns null (inside handleInvalidToken method). Due to which I receive a blank page. > Whenever I do a debug(from eclipse) on handleInvalidToken method, savedInvocation.getResultCode() value changes from null to "success" as I wait inside the method for sometime. > I have also put in savedInvocation.isExecuted() in this handleInvalidToken method and noticed that its value changes from false to true if I wait on the line of code for some time. -- This message was sent by Atlassian JIRA (v6.2#6252)