Hi all,

When no contexts for a Host are specified in server.xml, but all are placed in the META-INF of their respective apps,
how does one specify one of them as the default Context for that Host?

http://tomcat.apache.org/tomcat-5.5-doc/config/context.html doesn't seem to say what to do:

   path:    .......If you specify a context path of an empty string
   (""), you are defining the /default/ web application for this Host,
   which will process all requests not assigned to other Contexts. The
   value of this field must not be set except when statically defining
   a Context in server.xml, as it will be inferred from the filenames
   used for either the .xml context file or the docBase.

Using the simple Tomcat sample (http://tomcat.apache.org/tomcat-5.5-doc/appdev/sample/sample.war), I set up a test setting:

Host definition from server.xml:

     <Host appBase="webapps" name="strong-brain.com" unpackWARs="true"
   autoDeploy="true">
             <Alias>www.strong-brain.com</Alias>
             <Context path="/manager"
   docBase="/opt/tomcat5/server/webapps/manager" privileged="true"
   debug="0"/>
             <Context path="/admin"
   docBase="/opt/tomcat5/server/webapps/admin" privileged="true"
   debug="0"/>
             <Logger className="org.apache.catalina.logger.FileLogger"
   prefix="strong-brain.com." suffix=".txt" timestamp="true"/>
     </Host>

Applications in tomcat5/webapps:

   ROOT  sample  sample.war  sample2

[sample2 is just a slightly edited copy of sample]
Out of the box, neither has a context.xml in META-INF. Connecting to http://strong-brain.com/sample or http://strong-brain.com/sample2 gives the expected result, and connecting to http://strong-brain.com/ yields the Tomcat manager (Is that because it is the first context listed in Host??)

Despite the prohibition on using 'path=...' in Contexts in META-INF, I tried putting this in webapps/sample/META-INF/context.xml:

<Context path="" debug="10" reloadable="true" cookies="true"/>

It didn't have any effect. In particular, connecting to http://strong-brain.com/ still yielded the manager.

So how can I make sample or sample2 the default webapp for this Host, running when the connection to http://strong-brain.com/ is made???

Thanks,
Ken Bowen




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to