Bug 46262 - Undeploying context with %2F in it does not work
Summary: Undeploying context with %2F in it does not work
Status: RESOLVED DUPLICATE of bug 46261
Alias: None
Product: Tomcat 6
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 6.0.18
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: default
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-21 08:39 UTC by Joe Kislo
Modified: 2008-12-28 15:59 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joe Kislo 2008-11-21 08:39:40 UTC
Undeploying context with %2F in it does not work

This is related to the situation in bug #46261

If you have a context on disk named:

product%2Fcustomername.xml

If you try to undeploy it,you will get this error:

w3m http://localhost:8180/tomcat-manager/undeploy?path=/product/customername

FAIL - Context /product/clustername is defined in server.xml and may not be undeployed

The error is incorrect.  The context is not defined in server.xml, it's just that the:

Context context = (Context) host.findChild(path);

Check passes, and the

if (!isDeployed(path)) {

check fails (in ManagerServlet.java), which normally would imply the context must be deployed in the server.xml, however in this case the isDeployed lookup is just not working correctly for contexts with %2F in them.
Comment 1 Joe Kislo 2008-11-21 08:43:01 UTC
I do not have a patch for this issue, I work around this issue by doing:

w3m http://localhost:8180/tomcat-manager/undeploy?path=/product%252Fcustomername

instead, which works.  For this to work, you would have needed to apply the patch from bug #46261

Although I am fine with this work around, this does highlight that there is some inconsistency in the internal representation of context URLs in tomcat.  This workarond and the patch in bug #46261 could be eliminated if somebody could standardize how the urls should be stored in the various lookup tables in tomcat.  Unfortunately I am not equipped to say whether the URLs should be stored as:

/product/customername
/product%2Fcustomername
%2Fproduct%2Fcustomername

Which I believe are the three things I've seen being used in the tomcat code so far
Comment 2 Mark Thomas 2008-11-21 08:46:23 UTC
The correct way to do this in 6.0.18 is to use the # character rather than %2F.

%2F should be interpreted literally.
Comment 3 Mark Thomas 2008-12-28 15:59:35 UTC
The fix for 46261 also addresses this bug so I am marking this as a duplicate.

*** This bug has been marked as a duplicate of bug 46261 ***