using session-token interceptor generates FreeMarker template error
-------------------------------------------------------------------

                 Key: WW-1786
                 URL: https://issues.apache.org/struts/browse/WW-1786
             Project: Struts 2
          Issue Type: Bug
            Reporter: Tom Schneider
         Assigned To: Tom Schneider


This is a patch from webwork.

Original Description:
I'm trying to use the session token interceptor to prevent users from 
submitting the same form multiple times. It works but if I dispatch to a long 
JSP page I'm getting a Freemarker template error(see below). If I make the page 
very small it works perfectly, if I repeat the same content a few times(to make 
sure it's the length of the page and not the content which is generating the 
error) it gives the freemarker template error.

http://jira.opensymphony.com/browse/WW-1357

Index: 
/projects/backup/webwork-trunk/src/java/com/opensymphony/webwork/interceptor/TokenSessionStoreInterceptor.java
===================================================================
--- 
/projects/backup/webwork-trunk/src/java/com/opensymphony/webwork/interceptor/TokenSessionStoreInterceptor.java
      (revision 2795)
+++ 
/projects/backup/webwork-trunk/src/java/com/opensymphony/webwork/interceptor/TokenSessionStoreInterceptor.java
      (working copy)
@@ -107,6 +107,7 @@
             if (savedInvocation != null) {
                 // set the valuestack to the request scope
                 OgnlValueStack stack = savedInvocation.getStack();
+                Map context = stack.getContext();
                 
request.setAttribute(ServletActionContext.WEBWORK_VALUESTACK_KEY, stack);
 
                 Result result = savedInvocation.getResult();
@@ -112,7 +113,9 @@
                 Result result = savedInvocation.getResult();
 
                 if ((result != null) && 
(savedInvocation.getProxy().getExecuteResult())) {
-                    result.execute(savedInvocation);
+                    synchronized (context) {
+                        result.execute(savedInvocation);
+                    }
                 }
 
                 // turn off execution of this invocations result


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to