Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-1786

using session-token interceptor generates FreeMarker template error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.6
    • 2.0.7, 2.1.0
    • Core Interceptors
    • None
    • Patch

    Description

      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

      Attachments

        Issue Links

          Activity

            People

              tschneider Thomas Schneider
              tschneider Thomas Schneider
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: