You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by mr...@apache.org on 2006/10/01 03:52:26 UTC

svn commit: r451709 - /struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptor.java

Author: mrdon
Date: Sat Sep 30 18:52:25 2006
New Revision: 451709

URL: http://svn.apache.org/viewvc?view=rev&rev=451709
Log:
Fixed execute and wait interceptor to not _require_ validation to work
WW-1453

Modified:
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptor.java

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptor.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptor.java?view=diff&rev=451709&r1=451708&r2=451709
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptor.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptor.java Sat Sep 30 18:52:25 2006
@@ -168,7 +168,8 @@
     public static final String WAIT = "wait";
     protected int delay;
     protected int delaySleepInterval = 100; // default sleep 100 millis before checking if background process is done
-
+    protected boolean executeAfterValidationPass = false;
+    
     private int threadPriority = Thread.NORM_PRIORITY;
 
     /* (non-Javadoc)
@@ -198,12 +199,15 @@
         ActionContext context = actionInvocation.getInvocationContext();
         Map session = context.getSession();
 
-        Boolean secondTime = (Boolean) context.get(KEY);
-        if (secondTime == null) {
-            context.put(KEY, true);
-            secondTime = false;
-        } else {
-            secondTime = true;
+        Boolean secondTime  = true;
+        if (executeAfterValidationPass) {
+            secondTime = (Boolean) context.get(KEY);
+            if (secondTime == null) {
+                context.put(KEY, true);
+                secondTime = false;
+            } else {
+                secondTime = true;
+            }
         }
 
         synchronized (session) {
@@ -314,4 +318,16 @@
     public void setDelaySleepInterval(int delaySleepInterval) {
         this.delaySleepInterval = delaySleepInterval;
     }
+
+    /**
+     * Whether to start the background process after the second pass (first being validation)
+     * or not
+     * 
+     * @param executeAfterValidationPass the executeAfterValidationPass to set
+     */
+    public void setExecuteAfterValidationPass(boolean executeAfterValidationPass) {
+        this.executeAfterValidationPass = executeAfterValidationPass;
+    }
+    
+    
 }