Author: markt
Date: Mon Jan 18 08:19:54 2016
New Revision: 1725183

URL: http://svn.apache.org/viewvc?rev=1725183&view=rev
Log:
Prior to r1725113, a zero length string for sessionAttributeName would allow 
all attributes. Restore that behaviour for the new sessionAttributeName filter.
Clarify the behaviour of the pattern matching (anchored) and the behaviour for 
null and zero length strings.

Modified:
    tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java
    tomcat/trunk/webapps/docs/config/cluster-manager.xml
    tomcat/trunk/webapps/docs/config/manager.xml

Modified: tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java?rev=1725183&r1=1725182&r2=1725183&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java (original)
+++ tomcat/trunk/java/org/apache/catalina/session/ManagerBase.java Mon Jan 18 
08:19:54 2016
@@ -214,7 +214,7 @@ public abstract class ManagerBase extend
 
 
     public void setSessionAttributeNameFilter(String 
sessionAttributeNameFilter) {
-        if (sessionAttributeNameFilter == null) {
+        if (sessionAttributeNameFilter == null || 
sessionAttributeNameFilter.length() == 0) {
             sessionAttributeNamePattern = null;
         }
         sessionAttributeNamePattern = 
Pattern.compile(sessionAttributeNameFilter);

Modified: tomcat/trunk/webapps/docs/config/cluster-manager.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/cluster-manager.xml?rev=1725183&r1=1725182&r2=1725183&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/cluster-manager.xml (original)
+++ tomcat/trunk/webapps/docs/config/cluster-manager.xml Mon Jan 18 08:19:54 
2016
@@ -78,14 +78,15 @@
         nodes in the cluster.
       </attribute>
       <attribute name="sessionAttributeNameFilter" required="false">
-        A regular expression used to filter, which session attributes will
-        be replicated. An attribute will only be replicated, if its name
-        matches this pattern. If the pattern is not set (default), all
-        attributes are eligible for replication. As an example, the value
-        <code>^(userName|sessionHistory)$</code> will only replicate the two
-        session attributes named <code>userName</code> and
-        <code>sessionHistory</code>. This attribute was previously called
-        <strong>sessionAttributeFilter</strong>.
+        A regular expression used to filter which session attributes will be
+        replicated. An attribute will only be replicated if its name matches
+        this pattern. If the pattern is zero length or <code>null</code>, all
+        attributes are eligible for replication. The pattern is anchored so the
+        session attribute name must fully match the pattern. As an example, the
+        value <code>(userName|sessionHistory)</code> will only replicate the
+        two session attributes named <code>userName</code> and
+        <code>sessionHistory</code>. If not specified, the default value of
+        <code>null</code> will be used.
       </attribute>
       <attribute name="maxInactiveInterval" required="false">
         <p>The initial maximum time interval, in seconds,

Modified: tomcat/trunk/webapps/docs/config/manager.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/manager.xml?rev=1725183&r1=1725182&r2=1725183&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/manager.xml (original)
+++ tomcat/trunk/webapps/docs/config/manager.xml Mon Jan 18 08:19:54 2016
@@ -167,13 +167,15 @@
       </attribute>
 
       <attribute name="sessionAttributeNameFilter" required="false">
-        A regular expression used to filter, which session attributes will
-        be distributed. An attribute will only be distributed if its name
-        matches this pattern. If the pattern is not set (default), all
-        attributes are eligible for replication. As an example, the value
-        <code>^(userName|sessionHistory)$</code> will only distribute the two
-        session attributes named <code>userName</code> and
-        <code>sessionHistory</code>.
+        A regular expression used to filter which session attributes will be
+        distributed. An attribute will only be distributed if its name matches
+        this pattern. If the pattern is zero length or <code>null</code>, all
+        attributes are eligible for distribution. The pattern is anchored so 
the
+        session attribute name must fully match the pattern. As an example, the
+        value <code>(userName|sessionHistory)</code> will only distribute the
+        two session attributes named <code>userName</code> and
+        <code>sessionHistory</code>. If not specified, the default value of
+        <code>null</code> will be used.
       </attribute>
     </attributes>
 
@@ -265,13 +267,15 @@
         </p>
       </attribute>
       <attribute name="sessionAttributeNameFilter" required="false">
-        A regular expression used to filter, which session attributes will
-        be distributed. An attribute will only be distributed if its name
-        matches this pattern. If the pattern is not set (default), all
-        attributes are eligible for replication. As an example, the value
-        <code>^(userName|sessionHistory)$</code> will only distribute the two
-        session attributes named <code>userName</code> and
-        <code>sessionHistory</code>.
+        A regular expression used to filter which session attributes will be
+        distributed. An attribute will only be distributed if its name matches
+        this pattern. If the pattern is zero length or <code>null</code>, all
+        attributes are eligible for distribution. The pattern is anchored so 
the
+        session attribute name must fully match the pattern. As an example, the
+        value <code>(userName|sessionHistory)</code> will only distribute the
+        two session attributes named <code>userName</code> and
+        <code>sessionHistory</code>. If not specified, the default value of
+        <code>null</code> will be used.
       </attribute>
     </attributes>
 



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

Reply via email to