You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2009/12/16 00:37:12 UTC

DO NOT REPLY [Bug 48394] New: Support for "path" attribute in context.xml

https://issues.apache.org/bugzilla/show_bug.cgi?id=48394

           Summary: Support for "path" attribute in context.xml
           Product: Tomcat 6
           Version: 6.0.20
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: youngm@gmail.com


Currently Tomcat provides basically 2 ways to set the context path of an
application.

* Derived from the name of the .war or {context}.xml file.
* Set the path attribute of the context element in the server.xml

It would be nice if it were possible to set the path attribute in the context
element of a context.xml file.

I have a requirement where my application's context path must change depending
upon the environment it is deployed into.  Instead of renaming my .war for each
environment I would prefer to set the path attribute in the context.xml of the
.war to a catalina.properties property.  (e.g. <context
path="${contextPath}"/>)

Then set the value of ${contextPath} in my catalina.properties for the
different environments along with the other properties in my application that
change for each environment such as database connection information.

I could add a context entry in my server.xml but I'm hoping to keep application
specific configuration information out of my server.xml.  And from my
understanding use of context element in server.xml is somewhat deprecated.

If the path attribute is empty the tomcat can derive the context Path from the
file name just like it does now by default.  I just want to add support for the
path attribute if it is specified.

I'd be more than willing at taking a stab at a patch if I could get some sort
of assurance that the general concept of this issue is valid.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 48394] Support for "path" attribute in context.xml

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48394

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX

--- Comment #1 from Mark Thomas <ma...@apache.org> 2009-12-15 16:25:45 GMT ---
Such a change is likely to result in unwanted double deployment for many users
as well as significantly complicating the auto (un)deployment logic.

Defining contexts in server.xml is not deprecated. It is discouraged for those
use cases where the context could be defined outside server.xml

One possible solution would be to place your war files outside of the host's
appBase and use context.xml files in CATALINA_BASE/conf/Catalina/localhost. The
path will be derived from the name of the xml file but the WAR file can be
named whatever you like.

Another solution is to disable autoDeploy and deployOnStartup for the host and
explicitly define the contexts in server.xml

If you need further advice on your options in this area, please ask on the
users list.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org