Author: musachy Date: Mon Mar 30 17:58:42 2009 New Revision: 760071 URL: http://svn.apache.org/viewvc?rev=760071&view=rev Log: WW-3067 Add a configuration constant to turn on/off the logging of missing properties by OGNL
Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/StrutsConstants.java struts/struts2/trunk/core/src/main/java/org/apache/struts2/config/BeanSelectionProvider.java struts/struts2/trunk/core/src/main/resources/org/apache/struts2/default.properties Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/StrutsConstants.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/StrutsConstants.java?rev=760071&r1=760070&r2=760071&view=diff ============================================================================== --- struts/struts2/trunk/core/src/main/java/org/apache/struts2/StrutsConstants.java (original) +++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/StrutsConstants.java Mon Mar 30 17:58:42 2009 @@ -198,4 +198,7 @@ /** Throw RuntimeException when a property is not found, or the evaluation of the espression fails*/ public static final String STRUTS_EL_THROW_EXCEPTION = "struts.el.throwExceptionOnFailure"; + + /** Logs properties that are not found (very verbose) **/ + public static final String STRUTS_LOG_MISSING_PROPERTIES = "struts.ognl.logMissingProperties"; } Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/config/BeanSelectionProvider.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/config/BeanSelectionProvider.java?rev=760071&r1=760070&r2=760071&view=diff ============================================================================== --- struts/struts2/trunk/core/src/main/java/org/apache/struts2/config/BeanSelectionProvider.java (original) +++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/config/BeanSelectionProvider.java Mon Mar 30 17:58:42 2009 @@ -228,6 +228,8 @@ props.setProperty("devMode", "false"); } + props.setProperty("logMissingProperties", props.getProperty(StrutsConstants.STRUTS_LOG_MISSING_PROPERTIES)); + String val = props.getProperty(StrutsConstants.STRUTS_ALLOW_STATIC_METHOD_ACCESS); if (val != null) { props.setProperty("allowStaticMethodAccess", val); Modified: struts/struts2/trunk/core/src/main/resources/org/apache/struts2/default.properties URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/resources/org/apache/struts2/default.properties?rev=760071&r1=760070&r2=760071&view=diff ============================================================================== --- struts/struts2/trunk/core/src/main/resources/org/apache/struts2/default.properties (original) +++ struts/struts2/trunk/core/src/main/resources/org/apache/struts2/default.properties Mon Mar 30 17:58:42 2009 @@ -200,4 +200,7 @@ ### in an expression, or when the expression evaluation fails struts.el.throwExceptionOnFailure=false +### Logs as Warnings properties that are not found (very verbose) +struts.ognl.logMissingProperties=false + ### END SNIPPET: complete_file