diff --git a/core/src/main/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java b/core/src/main/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java index 6c3431871..07d318ad9 100644 --- a/core/src/main/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java +++ b/core/src/main/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java @@ -59,9 +59,6 @@ protected boolean execute_(ActionContext actionCtx) 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); @@ -79,6 +76,9 @@ protected boolean execute_(ActionContext actionCtx) populate(actionCtx, actionConfig, actionForm); } + // Always handle cancel last, as it needs populate first + handleCancel(actionCtx, actionConfig, actionForm); + return CONTINUE_PROCESSING; } @@ -198,4 +198,4 @@ protected void handleCancel(ActionContext context, context.setCancelled(Boolean.FALSE); } } -} \ No newline at end of file +}