Author: pbenedict
Date: Sun Jul  1 21:03:17 2007
New Revision: 552396

URL: http://svn.apache.org/viewvc?view=rev&rev=552396
Log:
STR-1674: Check cancellation first and possibly skip population

Modified:
    
struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java

Modified: 
struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java
URL: 
http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java?view=diff&rev=552396&r1=552395&r2=552396
==============================================================================
--- 
struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java
 (original)
+++ 
struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java
 Sun Jul  1 21:03:17 2007
@@ -45,21 +45,26 @@
      */
     public boolean execute(ActionContext actionCtx)
         throws Exception {
-        // Is there a form bean for this request?
+        
+        ActionConfig actionConfig = actionCtx.getActionConfig();
         ActionForm actionForm = actionCtx.getActionForm();
 
+        // First determine if the request was cancelled
+        handleCancel(actionCtx, actionConfig, actionForm);
+
+        // Is there a form bean for this request?
         if (actionForm == null) {
             return (false);
         }
 
-        // Reset the form bean property values
-        ActionConfig actionConfig = actionCtx.getActionConfig();
+        // If request is cancelled, form manipulation is prevented
+        if (actionCtx.getCancelled().booleanValue()) {
+            return (false);
+        }
 
+        // Reset and repopulate the form bean property values
         reset(actionCtx, actionConfig, actionForm);
-
         populate(actionCtx, actionConfig, actionForm);
-
-        handleCancel(actionCtx, actionConfig, actionForm);
 
         return (false);
     }


Reply via email to