Bug 46958 - manager XML interface hard-coded path in XSL transformation
manager XML interface hard-coded path in XSL transformation
Product: Tomcat 6
Classification: Unclassified
Component: Manager application
All All
: P2 normal (vote)
: default
Assigned To: Tomcat Developers Mailing List
Depends on:
  Show dependency tree
Reported: 2009-04-02 16:55 UTC by photodeus
Modified: 2009-04-28 06:19 UTC (History)
0 users

Patch to fix this bug. (1.78 KB, patch)
2009-04-05 05:06 UTC, Varun
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description photodeus 2009-04-02 16:55:36 UTC
The manager XML-interface cannot be used if it's installed under any other path than /manager, failing to find the xform.xsl file needed for XSL transformation.



Reason for error, in Tomcat sources
XML_STYLE returns the constant value 
"<?xml-stylesheet type=\"text/xsl\" href=\"/manager/xform.xsl\" ?>";

The /manager part needs to be modified to match webapp path.

public static void writeHeader(PrintWriter writer, final String contextPath, int mode) {
  // TODO needs current virtual webapp path as parameter


On a sidenote, in org.apache.catalina.manager.host.Constants there is a similar hard-coded value, which might cause similar problems in the future. It seems to be unreferenced in the current sources right now (unused value).
Comment 1 Varun 2009-04-05 05:06:28 UTC
Created attachment 23442 [details]
Patch to fix this bug.
Comment 2 Mark Thomas 2009-04-08 04:41:17 UTC
Thanks for the report.

Since it is only used in the one place I took the simpler option of using a relative path rather than an absolute one. It also saves having to handle the unlikely case of the manager app being deployed as ROOT in which case request.getContextPath() would return ""

I also removed the unused constants from the host manager.

The fix has been applied to trunk and proposed for 6.0.x
Comment 3 Mark Thomas 2009-04-28 06:19:15 UTC
This has been fixed in 6.0.x and will be in 6.0.20 onwards.