tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1140708 - in /tomcat/trunk: java/org/apache/catalina/manager/HTMLManagerServlet.java webapps/docs/changelog.xml
Date Tue, 28 Jun 2011 16:22:08 GMT
Author: markt
Date: Tue Jun 28 16:22:08 2011
New Revision: 1140708

URL: http://svn.apache.org/viewvc?rev=1140708&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51447
Viewing a back up session in the HTML Manager web application no longer changes the session
to a primary session.
Based on a patch provided by Eiji Takahashi.

Modified:
    tomcat/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java?rev=1140708&r1=1140707&r2=1140708&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java Tue Jun 28 16:22:08
2011
@@ -923,27 +923,18 @@ public final class HTMLManagerServlet ex
         }
         return sessions;
     }
+
     protected Session getSessionForNameAndId(ContextName cn, String id,
-            StringManager smClient) throws IOException {
-        if ((cn == null) || !(cn.getPath().startsWith("/") ||
-                cn.getPath().equals(""))) {
-            String path = null;
-            if (cn != null) {
-                path = cn.getPath();
+            StringManager smClient) {
+
+        List<Session> sessions = getSessionsForName(cn, smClient);
+        if (sessions == null || sessions.isEmpty()) return null;
+        for(Session session : sessions) {
+            if (session.getId().equals(id)) {
+                return session;
             }
-            throw new IllegalArgumentException(smClient.getString(
-                    "managerServlet.invalidPath",
-                    RequestUtil.filter(path)));
-        }
-        
-        Context ctxt = (Context) host.findChild(cn.getName());
-        if (null == ctxt) {
-            throw new IllegalArgumentException(smClient.getString(
-                    "managerServlet.noContext",
-                    RequestUtil.filter(cn.getDisplayName())));
         }
-        Session session = ctxt.getManager().findSession(id);
-        return session;
+        return null;
     }
 
     /**

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1140708&r1=1140707&r2=1140708&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Tue Jun 28 16:22:08 2011
@@ -228,6 +228,11 @@
         Add <code>session="false"</code> directive to the index page of the
         ROOT web application. (kkolinko)
       </fix>
+      <fix>
+        <bug>51447</bug>: Viewing a back up session in the HTML Manager web
+        application no longer changes the session to a primary session. Based on
+        a patch provided by Eiji Takahashi. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Other">



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


Mime
View raw message