DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=31892>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31892

Given Context-Path in Context-Descriptor ignored

           Summary: Given Context-Path in Context-Descriptor ignored
           Product: Tomcat 5
           Version: 5.5.3
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Catalina
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


If a context XML descriptor is placed like this:
$CATALINA_HOME/conf/[enginename]/[hostname]/abcxyz.xml

the application is deployed with context-Path /abcxyz
The filename of the context XML descriptor defines the URL-context implicit,
under which the application is accessible. An optional path="/xxx" Attribute
in the context XML descriptor is ignored.

This is not the case, when the context XML Fragment is directly placed in the
host-Section of server.xml.

DETAILS:
--------
The method 
HostConfig.deployDescriptor(String contextPath, File contextXml, String file)
is called when deploying an application with a context XML descriptor. Within
this method, the XML is parsed and a StandartContext Object is generated.

The parameter contextPath is never overridden by an optional given
path-Attribute in the context XML descriptor, which is accessible after XML
parsing under context.getName().

The following code-fragment in the mentioned method
HostConfig.deployDescriptor() shows a possible solution:

starting from line 572, HostConfig.java, Revision 1.48
------------------------------------------------------
[...]
context.setConfigFile(contextXml.getAbsolutePath());
if(context.getName()!=null)
{
  context.setPath( context.getName() ); // use Context in descriptor, when given
}
else
{
  context.setPath(contextPath);
}
[...]
-------------------------------------------------------------------

Oliver Henning
aloba ag, Switzerland

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to