Bug 51136 - Allow to set the context name through Tomcat's embeded class before adding it to the host
Summary: Allow to set the context name through Tomcat's embeded class before adding it...
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Catalina (show other bugs)
Version: trunk
Hardware: PC All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-29 16:18 UTC by David Calavera
Modified: 2011-05-04 08:48 UTC (History)
0 users



Attachments
patch that fix this issue (1.19 KB, patch)
2011-04-29 16:19 UTC, David Calavera
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Calavera 2011-04-29 16:18:31 UTC
org.apache.catalina.startup.Tomcat creates contexts and add them to the host directly. It would be nice if we could set the name of the context before adding it to the host.

I'm including a patch that overloads the methods "addWebapp" and "addContext" to take that name as a parameter.
Comment 1 David Calavera 2011-04-29 16:19:10 UTC
Created attachment 26942 [details]
patch that fix this issue
Comment 2 Mark Thomas 2011-05-04 08:48:11 UTC
Providing a patch that doesn't compile (two missing returns and contextName != name) doesn't help the chances that the patch will ever be applied. In this case the fixes were simple and the patch is useful so the issue were fixed and the patch has been applied. However, be aware that this is the exception rather than the rule and that typically, poor quality patches will be rejected.

The new methods will be in 7.0.13 onwards.