struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From musa...@apache.org
Subject svn commit: r789432 - in /struts/struts2/trunk/core/src/main: java/org/apache/struts2/StrutsConstants.java java/org/apache/struts2/config/BeanSelectionProvider.java resources/org/apache/struts2/default.properties
Date Mon, 29 Jun 2009 20:15:24 GMT
Author: musachy
Date: Mon Jun 29 20:15:24 2009
New Revision: 789432

URL: http://svn.apache.org/viewvc?rev=789432&view=rev
Log:
WW-3172 Add a flag to disable OGNL cache, which can cause memory leaks

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=789432&r1=789431&r2=789432&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 Jun
29 20:15:24 2009
@@ -209,4 +209,7 @@
 
     /** Logs properties that are not found (very verbose) **/
     public static final String STRUTS_LOG_MISSING_PROPERTIES = "struts.ognl.logMissingProperties";
+
+    /** Enables caching of parsed OGNL expressions **/
+    public static final String STRUTS_ENABLE_OGNL_EXPRESSION_CACHE = "struts.ognl.enableExpressionCache";
 }

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=789432&r1=789431&r2=789432&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 Jun 29 20:15:24 2009
@@ -231,6 +231,9 @@
         if (props.containsKey(StrutsConstants.STRUTS_LOG_MISSING_PROPERTIES))
             props.setProperty("logMissingProperties", props.getProperty(StrutsConstants.STRUTS_LOG_MISSING_PROPERTIES));
 
+        if (props.containsKey(StrutsConstants.STRUTS_ENABLE_OGNL_EXPRESSION_CACHE))
+            props.setProperty("enableOGNLExpressionCache", props.getProperty(StrutsConstants.STRUTS_ENABLE_OGNL_EXPRESSION_CACHE));
+
         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=789432&r1=789431&r2=789432&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
Jun 29 20:15:24 2009
@@ -203,4 +203,7 @@
 ### Logs as Warnings properties that are not found (very verbose)
 struts.ognl.logMissingProperties=false
 
+### Chaches parsed OGNL expressions, but can lead to memory leaks
+### if the application generates a lot of different expressions
+struts.ognl.enableExpressionCache=true
 ### END SNIPPET: complete_file



Mime
View raw message