Commits

Anonymous committed a456f00

WW-2683 Request parameters with no corresponding setter cause errors to be logged
o if devMode is enabled, those will be logged with warn level now

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

  • Participants
  • Parent commits e23011c

Comments (0)

Files changed (1)

src/java/com/opensymphony/xwork2/ognl/accessor/CompoundRootAccessor.java

 package com.opensymphony.xwork2.ognl.accessor;
 
 import com.opensymphony.xwork2.XWorkException;
+import com.opensymphony.xwork2.inject.Inject;
 import com.opensymphony.xwork2.util.CompoundRoot;
 import com.opensymphony.xwork2.util.ValueStack;
 import com.opensymphony.xwork2.util.logging.Logger;
     private final static Logger LOG = LoggerFactory.getLogger(CompoundRootAccessor.class);
     private static Map invalidMethods = new HashMap();
 
+    static boolean devMode = false;
+
+    @Inject("devMode")
+    public static void setDevMode(String mode) {
+        devMode = "true".equals(mode);
+    }
 
     public void setProperty(Map context, Object target, Object name, Object value) throws OgnlException {
         CompoundRoot root = (CompoundRoot) target;
         if ((reportError != null) && (reportError.booleanValue())) {
             throw new XWorkException(msg);
         } else {
-            LOG.debug(msg);
+            if (devMode) {
+                LOG.warn(msg);
+            }
         }
     }