tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r951985 - in /tomcat/trunk: java/org/apache/catalina/session/StandardSession.java webapps/docs/config/systemprops.xml
Date Sun, 06 Jun 2010 21:24:10 GMT
Author: markt
Date: Sun Jun  6 21:24:09 2010
New Revision: 951985

URL: http://svn.apache.org/viewvc?rev=951985&view=rev
Log:
Final part of refactoring STRICT_SERVLET_COMPLIANCE so it just changes defaults
New property LAST_ACCESS_AT_START

Modified:
    tomcat/trunk/java/org/apache/catalina/session/StandardSession.java
    tomcat/trunk/webapps/docs/config/systemprops.xml

Modified: tomcat/trunk/java/org/apache/catalina/session/StandardSession.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/StandardSession.java?rev=951985&r1=951984&r2=951985&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/session/StandardSession.java (original)
+++ tomcat/trunk/java/org/apache/catalina/session/StandardSession.java Sun Jun  6 21:24:09
2010
@@ -88,11 +88,10 @@ public class StandardSession
 
     protected static final boolean ACTIVITY_CHECK;
 
+    protected static final boolean LAST_ACCESS_AT_START;
 
     static {
-        STRICT_SERVLET_COMPLIANCE = Boolean.valueOf(System.getProperty(
-                "org.apache.catalina.STRICT_SERVLET_COMPLIANCE",
-                "false")).booleanValue();
+        STRICT_SERVLET_COMPLIANCE = Globals.STRICT_SERVLET_COMPLIANCE;
         
         String activityCheck = System.getProperty(
                 "org.apache.catalina.session.StandardSession.ACTIVITY_CHECK");
@@ -102,6 +101,15 @@ public class StandardSession
             ACTIVITY_CHECK =
                 Boolean.valueOf(activityCheck).booleanValue();
         }
+
+        String lastAccessAtStart = System.getProperty(
+                "org.apache.catalina.session.StandardSession.LAST_ACCESS_AT_START");
+        if (lastAccessAtStart == null) {
+            LAST_ACCESS_AT_START = STRICT_SERVLET_COMPLIANCE;
+        } else {
+            LAST_ACCESS_AT_START =
+                Boolean.valueOf(lastAccessAtStart).booleanValue();
+        }
     }
     
 
@@ -614,7 +622,7 @@ public class StandardSession
         if (maxInactiveInterval >= 0) { 
             long timeNow = System.currentTimeMillis();
             int timeIdle;
-            if (Globals.STRICT_SERVLET_COMPLIANCE) {
+            if (LAST_ACCESS_AT_START) {
                 timeIdle = (int) ((timeNow - lastAccessedTime) / 1000L);
             } else {
                 timeIdle = (int) ((timeNow - thisAccessedTime) / 1000L);
@@ -668,7 +676,7 @@ public class StandardSession
          * The servlet spec mandates to ignore request handling time
          * in lastAccessedTime.
          */
-        if (Globals.STRICT_SERVLET_COMPLIANCE) {
+        if (LAST_ACCESS_AT_START) {
             this.lastAccessedTime = this.thisAccessedTime;
             this.thisAccessedTime = System.currentTimeMillis();
         } else {

Modified: tomcat/trunk/webapps/docs/config/systemprops.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/systemprops.xml?rev=951985&r1=951984&r2=951985&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/systemprops.xml (original)
+++ tomcat/trunk/webapps/docs/config/systemprops.xml Sun Jun  6 21:24:09 2010
@@ -228,6 +228,7 @@
       <li><code>org.apache.catalina.core.ApplicationDispatcher.WRAP_SAME_OBJECT</code></li>
       <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.catalina.session.StandardSession.LAST_ACCESS_AT_START</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>
       <li><code>org.apache.tomcat.util.http.ServerCookie.STRICT_NAMING</code>.</li>
@@ -368,6 +369,18 @@
       else the default value will be <code>false</code>.</p>
     </property>
 
+    <property
+    name="org.apache.catalina.session. StandardSession.LAST_ACCESS_AT_START">
+      <p>If this is <code>true</code>, the last accessed time for sessions
will
+      be calculated from the beginning of the previous request. If
+      <code>false</code>, the last accessed time for sessions will be calculated
+      from the end of the previous request. This also affects how the idle time
+      is calculated. 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>
+
   </properties>
 
 </section>



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


Mime
View raw message