Chris Riekenberg wrote:

Hmm... might help to define "But it doesn't work."  How exactly does it
not work?


He returns a Http error 404. Page could not find.

For the record, you Context element should *not* be in
conf/context.xml.  That file defines defaults for all webapps.  It
*should* be in one of two places:

Interessting. So in context.xml I would only define global context.

[TomcatHome]/conf/context.xml defines defaults for all the other webapps. If it's not explicitly defined in a particular webapp's context, it's looked for here.

webapps/StrutsDemo/META-INF/context.xml  in which case your webapp will
respond to requests to http://[myServer:port]/StrutsDemo.

conf/Catalina/localhost/StrutsDemo.xml in which case your webapp will
respond to requests to http://[myServer:port]/StrutsDemo.

The call http://[myServer:port]/StrutsDemo already works. I would like
to map to another context. So it would be useless to define an
additionally context.xml if it works without.



So you want you make your webapp to also respond at http://[myServer:port]/welcome. You can achieve a second launch of your webapp just by placing welcome.xml (w/ your Context config) in [TomcatHome]/conf/Catalina/localhost. Just know this is a second launch, not an alias to the first running instance.

The key thing here is your docBase and the name of your xml file in
conf/Catalina/localhost should reflect the path name.  If you really
want path != docBase, you will have to store your webapp outside
tomcat's webapps directory and store the Context definition in
conf/Catalina/localhost/welcome.xml.  In that case your webapp will
respond to http://[myServer:port]/welcome/

So if a xml file exist in /conf/Catalina/localhost which is suitable for
a webapps folder, he ignore a context within this file, but if the folder
doesn't exist, he will use this context?

I'm reasonably sure conf/Catalina/localhost/StrutsDemo.xml trumps webapps/StrutsDemo/META-INF/context.xml if both are present.

Thank you very much for this answer.

greetz
chris


--David

Chris Riekenberg wrote:

Hey,

I'm using Tomcat 5.5.12. If I created a context mapping in
/conf/server.xml to cnetext /welcome.

<Context path="/welcome" docBase="StrutsDemo" />

If I do it like this, it works. But I read, that you should not
insert a mapping in server.xml (bad style?) You should prefer
to insert it into
/conf/context.xml
or
\conf\Catalina\localhost\<ApplicationName>.xml


In both I tried this one:
"<Context path="/welcome" docBase="StrutsDemo">
</Context>"

But it doesn't work. Did I do something wrong?

greetz
Christian

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



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





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



---------------------------------------------------------------------
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