Commits

Anonymous committed 61b85ce

XW-541 add a clearErrors() and clearMessages() method to ActionSupport

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@1552e221344d-f017-0410-9bd5-d282ab1896d7

Comments (0)

Files changed (2)

src/java/com/opensymphony/xwork2/ActionSupport.java

     }
 
     /**
+     * Clears field errors. Useful for Continuations and other situations
+     * where you might want to clear parts of the state on the same action.
+     */
+    public void clearFieldErrors() {
+        validationAware.clearFieldErrors();
+    }
+
+    /**
+     * Clears action errors. Useful for Continuations and other situations
+     * where you might want to clear parts of the state on the same action.
+     */
+    public void clearActionErrors() {
+        validationAware.clearActionErrors();
+    }
+
+    /**
+     * Clears messages. Useful for Continuations and other situations
+     * where you might want to clear parts of the state on the same action.
+     */
+    public void clearMessages() {
+        validationAware.clearMessages();
+    }
+
+    /**
+     * Clears all errors. Useful for Continuations and other situations
+     * where you might want to clear parts of the state on the same action.
+     */
+    public void clearErrors() {
+        validationAware.clearErrors();
+    }
+
+    /**
      * Clears all errors and messages. Useful for Continuations and other situations
      * where you might want to clear parts of the state on the same action.
      */

src/java/com/opensymphony/xwork2/ValidationAwareSupport.java

     }
 
     /**
+     * Clears field errors map.
+     * <p/>
+     * Will clear the map that contains field errors.
+     */
+    public synchronized void clearFieldErrors() {
+        internalGetFieldErrors().clear();
+    }
+
+    /**
+     * Clears action errors list.
+     * <p/>
+     * Will clear the list that contains action errors.
+     */
+    public synchronized void clearActionErrors() {
+        internalGetActionErrors().clear();
+    }
+
+    /**
+     * Clears messages list.
+     * <p/>
+     * Will clear the list that contains action messages.
+     */
+    public synchronized void clearMessages() {
+        internalGetActionMessages().clear();
+    }
+
+    /**
+     * Clears all error list/maps.
+     * <p/>
+     * Will clear the map and list that contain
+     * field errors and action errors.
+     */
+    public synchronized void clearErrors() {
+        internalGetFieldErrors().clear();
+        internalGetActionErrors().clear();
+    }
+
+    /**
      * Clears all error and messages list/maps.
      * <p/>
      * Will clear the maps/lists that contain