Ok... I'm not sure, it isnt intuitive, almost like context paths are a useless extra, I cant say I understand it either.

If I want a servlet to say work on /test/secondlevel/

I change the name of the webapp to "test".... and I also change the context path in conf /engine/location/ to "test" **even though it seems to do nothing**

Then I map the secondary stuff in web.xml ie

<servlet-mapping>

<servlet-name>servlet name</servlet-name>

<url-pattern>/secondlevel/*</url-pattern>

</servlet-mapping>

Oh and if you want to address a JSP page as /test/secondlevel/
then you need to move the JSP page to a folder called secondlevel under the Application called "test".

Thing is, if you ignore context paths and compare the urls to the physical files and servlet mapping... its actually very intuitive WITHOUT context paths, starts looking like a normal web site mapping.

Maybe that helps... its a good question, maybe a guru can tell us why it behaves like this... it almost like context paths are a legacy thing that is being phased out????

It seems to all depend on the name of the WAR file, and the folders under webapps... for example look for the ROOT context path... its not in the default tomcat setup... I think its all in the name of the file, and we must just look at the folder and servlet mapping to see whats going to happen to a URI.

Think they should just take it out.... what do they actually do?

BUT just to confuse the hell out of us...

If for example in netbeans... you make the context /IgnoreAppname/ShowJspsHere/ and Run it IN the IDE.... it WILL use that context path.... AND it will package it with that context, and it will reflect in Tomcat conf/engine/location once deployed.... BUT then tomcat ignores it and just uses the file name....

In netbeans I never touch the context path except in the case of making a ROOT webapp.
And then its just the same as a web server... and that seems to work.

Dont know why but if I had to guess.... I think the context paths are proving to be one mapping too many. If you think about servlet mapping, virtual hosts, mod_jk mapping and all the rest of it... programming for context paths must be a pain in the butt.

I think I can live without them... but I think they should either make them work.... or take them out completely.



----- Original Message ----- From: "mrpapini" <[EMAIL PROTECTED]>
To: <users@tomcat.apache.org>
Sent: Tuesday, April 10, 2007 7:32 PM
Subject: Multilevel context path problem



I have a problem deploying war file and specifying multilevel context path.
Similar question was asked in this forum before but without definitive
answer. My scenario is as follow, I have a war file, say webtest.war and I'd
like to access it by:
/test/webtest. I found the only way to do so is to actually create context
entry for this in server.xml inside host element.
Trying to create test#webtest.xml in conf/engine/host directory would not
work, tomcat would throw exception trying to access docBase test/webtest
(tomcat expands war file into webtest directory only). I've tried many
combinations and scenarios, nothing would work except having context inside
server.xml. However, that is bad because, 1. it seems to be deprecated, 2.
does not allow for dynamic reload. Anybody can share light on this? Is there
any combinations of settings/naming that would allow me to access webtest
app via /test/webtest context?

Regards,
-pp

--
View this message in context: http://www.nabble.com/Multilevel-context-path-problem-tf3554394.html#a9924480
Sent from the Tomcat - User mailing list archive at Nabble.com.


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