tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r1089638 - in /tomcat/trunk: java/org/apache/catalina/manager/Constants.java java/org/apache/catalina/manager/StatusManagerServlet.java java/org/apache/catalina/manager/StatusTransformer.java webapps/docs/changelog.xml
Date Wed, 06 Apr 2011 21:31:25 GMT
Author: rjung
Date: Wed Apr  6 21:31:25 2011
New Revision: 1089638

URL: http://svn.apache.org/viewvc?rev=1089638&view=rev
Log:
Fix broken stylesheet URL in XML based manager status output.

The URLs of the status base pages have a varying number
of path segments, so a relativ URL to the stylesheet
does no longer work.

Modified:
    tomcat/trunk/java/org/apache/catalina/manager/Constants.java
    tomcat/trunk/java/org/apache/catalina/manager/StatusManagerServlet.java
    tomcat/trunk/java/org/apache/catalina/manager/StatusTransformer.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/manager/Constants.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/Constants.java?rev=1089638&r1=1089637&r2=1089638&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/manager/Constants.java (original)
+++ tomcat/trunk/java/org/apache/catalina/manager/Constants.java Wed Apr  6 21:31:25 2011
@@ -210,7 +210,7 @@ public class Constants {
         "<?xml version=\"1.0\" encoding=\""+CHARSET+"\"?>";
 
     public static final String XML_STYLE =
-        "<?xml-stylesheet type=\"text/xsl\" href=\"xform.xsl\" ?>";
+        "<?xml-stylesheet type=\"text/xsl\" href=\"{0}/xform.xsl\" ?>\n";
 
 }
 

Modified: tomcat/trunk/java/org/apache/catalina/manager/StatusManagerServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/StatusManagerServlet.java?rev=1089638&r1=1089637&r2=1089638&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/manager/StatusManagerServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/manager/StatusManagerServlet.java Wed Apr  6 21:31:25
2011
@@ -199,10 +199,12 @@ public class StatusManagerServlet
             completeStatus = true;
         }
         // use StatusTransformer to output status
-        StatusTransformer.writeHeader(writer,mode);
+        Object[] args = new Object[1];
+        args[0] = request.getContextPath();
+        StatusTransformer.writeHeader(writer,args,mode);
 
         // Body Header Section
-        Object[] args = new Object[2];
+        args = new Object[2];
         args[0] = request.getContextPath();
         if (completeStatus) {
             args[1] = sm.getString("statusServlet.complete");

Modified: tomcat/trunk/java/org/apache/catalina/manager/StatusTransformer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/StatusTransformer.java?rev=1089638&r1=1089637&r2=1089638&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/manager/StatusTransformer.java (original)
+++ tomcat/trunk/java/org/apache/catalina/manager/StatusTransformer.java Wed Apr  6 21:31:25
2011
@@ -64,17 +64,18 @@ public class StatusTransformer {
      * Write an HTML or XML header.
      *
      * @param writer the PrintWriter to use
+     * @param args Path prefix for URLs
      * @param mode - 0 = HTML header, 1 = XML declaration
      *
      */
-    public static void writeHeader(PrintWriter writer, int mode) {
+    public static void writeHeader(PrintWriter writer, Object[] args, int mode) {
         if (mode == 0){
             // HTML Header Section
             writer.print(Constants.HTML_HEADER_SECTION);
         } else if (mode == 1){
             writer.write(Constants.XML_DECLARATION);
-            writer.write
-                (Constants.XML_STYLE);
+            writer.print(MessageFormat.format
+                     (Constants.XML_STYLE, args));
             writer.write("<status>");
         }
     }

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1089638&r1=1089637&r2=1089638&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Wed Apr  6 21:31:25 2011
@@ -73,6 +73,9 @@
         conf/catalina.policy file when the documentation is built, rather
         than maintaining a copy of its content. (kkolinko)
       </update>
+      <fix>
+        Fix broken stylesheet URL in XML based manager status output. (rjung)
+      </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