You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2010/06/06 20:29:26 UTC

svn commit: r951922 - in /tomcat/trunk: java/org/apache/catalina/core/StandardHostValve.java webapps/docs/config/systemprops.xml

Author: markt
Date: Sun Jun  6 18:29:26 2010
New Revision: 951922

URL: http://svn.apache.org/viewvc?rev=951922&view=rev
Log:
Part of refactoring STRICT_SERVLET_COMPLIANCE so it just changes defaults
New ACCESS_SESSION property

Modified:
    tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java
    tomcat/trunk/webapps/docs/config/systemprops.xml

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java?rev=951922&r1=951921&r2=951922&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java Sun Jun  6 18:29:26 2010
@@ -61,6 +61,25 @@ final class StandardHostValve
 
     private static final Log log = LogFactory.getLog(StandardHostValve.class);
 
+    protected static final boolean STRICT_SERVLET_COMPLIANCE;
+
+    protected static final boolean ACCESS_SESSION;
+
+    static {
+        STRICT_SERVLET_COMPLIANCE = Boolean.valueOf(System.getProperty(
+                "org.apache.catalina.STRICT_SERVLET_COMPLIANCE",
+                "false")).booleanValue();
+        
+        String accessSession = System.getProperty(
+                "org.apache.catalina.core.StandardHostValve.ACCESS_SESSION");
+        if (accessSession == null) {
+            ACCESS_SESSION = STRICT_SERVLET_COMPLIANCE;
+        } else {
+            ACCESS_SESSION =
+                Boolean.valueOf(accessSession).booleanValue();
+        }
+    }
+
     //------------------------------------------------------ Constructor
     public StandardHostValve() {
         super(true);
@@ -147,7 +166,7 @@ final class StandardHostValve
 
         // Access a session (if present) to update last accessed time, based on a
         // strict interpretation of the specification
-        if (Globals.STRICT_SERVLET_COMPLIANCE) {
+        if (ACCESS_SESSION) {
             request.getSession(false);
         }
 
@@ -205,7 +224,7 @@ final class StandardHostValve
 
         // Access a session (if present) to update last accessed time, based on a
         // strict interpretation of the specification
-        if (Globals.STRICT_SERVLET_COMPLIANCE) {
+        if (ACCESS_SESSION) {
             request.getSession(false);
         }
 

Modified: tomcat/trunk/webapps/docs/config/systemprops.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/systemprops.xml?rev=951922&r1=951921&r2=951922&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/systemprops.xml (original)
+++ tomcat/trunk/webapps/docs/config/systemprops.xml Sun Jun  6 18:29:26 2010
@@ -228,10 +228,6 @@
       dispatcher will be checked to ensure that it has wrapped the original
       request or response. (SRV.8.2 / SRV.14.2.5.1)
       </li>
-      <li>every request that is associated with a session will cause the
-      session's last accessed time to be updated regardless of whether or not
-      the request explicitly accesses the session. (SRV.7.6)  
-      </li>
       <li>
         <code>ServletContext.getResource/getResourceAsStream</code> must start with "/"<br/>
         if set to false, code like <code>getResource("myfolder/myresource.txt")</code> will work
@@ -239,6 +235,7 @@
       <li>
         The default value will be changed for:
         <ul>
+        <li><code>org.apache.catalina.core.StandardHostValve.ACCESS_SESSION</code></li>
         <li><code>org.apache.catalina.session.StandardSession.ACTIVITY_CHECK</code></li>
         <li><code>org.apache.tomcat.util.http.ServerCookie.ALWAYS_ADD_EXPIRES</code>.</li>
         <li><code>org.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR</code>.</li>
@@ -343,9 +340,18 @@
       <code>JSESSIONIDSSO</code>.</p>
     </property>
     
+    <property name="org.apache.catalina.core. StandardHostValve.ACCESS_SESSION">
+      <p>If this is <code>true</code>, every request that is associated with a
+      session will cause the session's last accessed time to be updated
+      regardless of whether or not the request explicitly accesses the session.
+      If <code>org.apache.catalina.STRICT_SERVLET_COMPLIANCE</code> is set to
+      <code>true</code>, the default of this setting will be <code>true</code>,
+      else the default value will be <code>false</code>.</p>
+    </property>
+    
     <property
     name="org.apache.catalina.session. StandardSession.ACTIVITY_CHECK">
-      <p>If this is <code>true</code> Tomcat will track the number of active
+      <p>If this is <code>true</code>, Tomcat will track the number of active
       requests for each session. When determining if a session is valid, any
       session with at least one active request will always be considered valid.
       If <code>org.apache.catalina.STRICT_SERVLET_COMPLIANCE</code> is set to



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org