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

svn commit: r1065530 - /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ChainingInterceptor.java

Author: lukaszlenart
Date: Mon Jan 31 09:03:29 2011
New Revision: 1065530

URL: http://svn.apache.org/viewvc?rev=1065530&view=rev
Log:
WW-3488 - adds copy field errors to exclude list during chaining

Modified:
    struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ChainingInterceptor.java

Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ChainingInterceptor.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ChainingInterceptor.java?rev=1065530&r1=1065529&r2=1065530&view=diff
==============================================================================
--- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ChainingInterceptor.java (original)
+++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ChainingInterceptor.java Mon Jan 31 09:03:29 2011
@@ -103,14 +103,16 @@ public class ChainingInterceptor extends
     private static final Logger LOG = LoggerFactory.getLogger(ChainingInterceptor.class);
 
     private static final String ACTION_ERRORS = "actionErrors";
+    private static final String FIELD_ERRORS = "fieldErrors";
     private static final String ACTION_MESSAGES = "actionMessages";
 
     private boolean copyMessages = false;
     private boolean copyErrors = false;
+    private boolean copyFieldErrors = false;
 
     protected Collection<String> excludes;
-    protected Collection<String> includes;
 
+    protected Collection<String> includes;
     protected ReflectionProvider reflectionProvider;
 
     @Inject
@@ -123,6 +125,11 @@ public class ChainingInterceptor extends
         this.copyErrors = "true".equalsIgnoreCase(copyErrors);
     }
 
+    @Inject(value = "struts.xwork.chaining.copyFieldErrors", required = false)
+    public void setCopyFieldErrors(String copyFieldErrors) {
+        this.copyErrors = "true".equalsIgnoreCase(copyFieldErrors);
+    }
+
     @Inject(value = "struts.xwork.chaining.copyMessages", required = false)
     public void setCopyMessages(String copyMessages) {
         this.copyMessages = "true".equalsIgnoreCase(copyMessages);
@@ -150,7 +157,7 @@ public class ChainingInterceptor extends
 
     private Collection<String> prepareExcludes() {
         Collection<String> localExcludes = excludes;
-        if (!copyErrors || !copyMessages) {
+        if (!copyErrors || !copyMessages ||!copyFieldErrors) {
             if (localExcludes == null) {
                 localExcludes = new HashSet<String>();
                 if (!copyErrors) {
@@ -159,6 +166,9 @@ public class ChainingInterceptor extends
                 if (!copyMessages) {
                     localExcludes.add(ACTION_MESSAGES);
                 }
+                if (!copyFieldErrors) {
+                    localExcludes.add(FIELD_ERRORS);
+                }
             }
         }
         return localExcludes;