Re: getContextPath

2006-10-31 Thread David Smith
At each stage of request resolution, the longest match wins.  At the 
point where the request is routed to a particular webapp, it matches the 
webapp whose context matches more of the request path than any other.  
IE in your case, if there is a root webapp with context "" and a webapp 
with context "test", the webapp at context "test" will receive the 
request.  If you want further clarification, see in the default ROOT 
webapp that ships with tomcat.  There's a placeholder /admin/index.html 
that's only active as long as the admin webapp isn't installed.


--David

mast wrote:
little correction it seem that if i put a directory in the same way as 
the ROOT directory tomcat use it instead of the other

exemple :
/usr/local/tomcat5/webapps/users1/ROOT/test/test.jsp
/usr/local/tomcat5/webapps/users1/test/test.jsp

tomcat use the second one (and their appear the ContextPath: /test )
is this the normal way of tomcat working? if so all is ok thanks for all
- Original Message - From: "mast" <[EMAIL PROTECTED]>
To: "Tomcat Users List" 
Sent: Tuesday, October 31, 2006 11:04 PM
Subject: Re: getContextPath



Hmm well it seem i have made a mistake
the server.xml is correct and my configuration under ROOT too but it 
seem that if i put some file before the ROOT directory tomcat take 
that as the defaut context?

i explain :
i have put like i said :
appBase="/usr/local/tomcat5/webapps/users1"
there i have create a ROOT directory 
/usr/local/tomcat5/webapps/users1/ROOT/ (WEB-INF etc after the ROOT)
but i had a WEB-INF and META-INF in the same directory as the ROOT 
too and they seem to have been taken instead of the one in the ROOT 
one (is it normal?)

now all works fine sorry to have make you loose time.



- Original Message - From: "mast" <[EMAIL PROTECTED]>
To: "Tomcat Users List" 
Sent: Tuesday, October 31, 2006 10:51 PM
Subject: Re: getContextPath



>From: "Caldarale, Charles R" <[EMAIL PROTECTED]>

To: "Tomcat Users List" 
Sent: Tuesday, October 31, 2006 10:37 PM
Subject: RE: getContextPath
Do you have a test.xml lurking around in conf/[engine]/[host] in 
one of

them?  Would that test.xml have a  element with a docBase
pointing to ROOT/test?  If so, that's incorrect.


each webapps is independant my app is the ROOT directory now i 
define host like that :

appBase="/usr/local/tomcat5/webapps/users1"
appBase="/usr/local/tomcat5/webapps/users2"
each one have their own ROOT directory
but for the actual problem   i dont have any test.xml file or 
anything else on engine (or elsewhere that i can see)
both the 5.5.20 and 5.5.17 are new tomcat installed exactly the same 
way no docbase or anything else that i can see



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



RE: getContextPath

2006-10-31 Thread Caldarale, Charles R
> From: mast [mailto:[EMAIL PROTECTED] 
> Subject: Re: getContextPath
> 
>  /usr/local/tomcat5/webapps/users1/ROOT/test/test.jsp
>  /usr/local/tomcat5/webapps/users1/test/test.jsp
> 
> tomcat use the second one (and their appear the ContextPath: /test )
> is this the normal way of tomcat working? if so all is ok 

Yes, any directory or .war file directly under the appBase is considered
to be a webapp and is deployed as such.  I don't know if the spec
documents which one should take precedence, but it seems like asking for
trouble to do such a thing.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

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



Re: getContextPath

2006-10-31 Thread mast
little correction it seem that if i put a directory in the same way as the 
ROOT directory tomcat use it instead of the other

exemple :
/usr/local/tomcat5/webapps/users1/ROOT/test/test.jsp
/usr/local/tomcat5/webapps/users1/test/test.jsp

tomcat use the second one (and their appear the ContextPath: /test )
is this the normal way of tomcat working? if so all is ok thanks for all
- Original Message - 
From: "mast" <[EMAIL PROTECTED]>

To: "Tomcat Users List" 
Sent: Tuesday, October 31, 2006 11:04 PM
Subject: Re: getContextPath



Hmm well it seem i have made a mistake
the server.xml is correct and my configuration under ROOT too but it seem 
that if i put some file before the ROOT directory tomcat take that as the 
defaut context?

i explain :
i have put like i said :
appBase="/usr/local/tomcat5/webapps/users1"
there i have create a ROOT directory 
/usr/local/tomcat5/webapps/users1/ROOT/ (WEB-INF etc after the ROOT)
but i had a WEB-INF and META-INF in the same directory as the ROOT too and 
they seem to have been taken instead of the one in the ROOT one (is it 
normal?)

now all works fine sorry to have make you loose time.



- Original Message - 
From: "mast" <[EMAIL PROTECTED]>

To: "Tomcat Users List" 
Sent: Tuesday, October 31, 2006 10:51 PM
Subject: Re: getContextPath



>From: "Caldarale, Charles R" <[EMAIL PROTECTED]>

To: "Tomcat Users List" 
Sent: Tuesday, October 31, 2006 10:37 PM
Subject: RE: getContextPath
Do you have a test.xml lurking around in conf/[engine]/[host] in one of
them?  Would that test.xml have a  element with a docBase
pointing to ROOT/test?  If so, that's incorrect.


each webapps is independant my app is the ROOT directory now i define 
host like that :

appBase="/usr/local/tomcat5/webapps/users1"
appBase="/usr/local/tomcat5/webapps/users2"
each one have their own ROOT directory
but for the actual problem   i dont have any test.xml file or anything 
else on engine (or elsewhere that i can see)
both the 5.5.20 and 5.5.17 are new tomcat installed exactly the same way 
no docbase or anything else that i can see



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



RE: getContextPath

2006-10-31 Thread Caldarale, Charles R
> From: mast [mailto:[EMAIL PROTECTED] 
> Subject: Re: getContextPath
> 
> but i had a WEB-INF and META-INF in the same directory as the 
> ROOT too and they seem to have been taken instead of the one
> in the ROOT one (is it normal?)

Not sure what you mean by "normal", but since the setup was in error,
there are no guarantees that Tomcat will do anything useful with it.

Glad you finally figured it out.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

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



Re: getContextPath

2006-10-31 Thread mast

Hmm well it seem i have made a mistake
the server.xml is correct and my configuration under ROOT too but it seem 
that if i put some file before the ROOT directory tomcat take that as the 
defaut context?

i explain :
i have put like i said :
appBase="/usr/local/tomcat5/webapps/users1"
there i have create a ROOT directory /usr/local/tomcat5/webapps/users1/ROOT/ 
(WEB-INF etc after the ROOT)
but i had a WEB-INF and META-INF in the same directory as the ROOT too and 
they seem to have been taken instead of the one in the ROOT one (is it 
normal?)

now all works fine sorry to have make you loose time.



- Original Message - 
From: "mast" <[EMAIL PROTECTED]>

To: "Tomcat Users List" 
Sent: Tuesday, October 31, 2006 10:51 PM
Subject: Re: getContextPath



>From: "Caldarale, Charles R" <[EMAIL PROTECTED]>

To: "Tomcat Users List" 
Sent: Tuesday, October 31, 2006 10:37 PM
Subject: RE: getContextPath
Do you have a test.xml lurking around in conf/[engine]/[host] in one of
them?  Would that test.xml have a  element with a docBase
pointing to ROOT/test?  If so, that's incorrect.


each webapps is independant my app is the ROOT directory now i define host 
like that :

appBase="/usr/local/tomcat5/webapps/users1"
appBase="/usr/local/tomcat5/webapps/users2"
each one have their own ROOT directory
but for the actual problem   i dont have any test.xml file or anything 
else on engine (or elsewhere that i can see)
both the 5.5.20 and 5.5.17 are new tomcat installed exactly the same way 
no docbase or anything else that i can see



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



Re: getContextPath

2006-10-31 Thread mast

From: "Caldarale, Charles R" <[EMAIL PROTECTED]>
To: "Tomcat Users List" 
Sent: Tuesday, October 31, 2006 10:37 PM
Subject: RE: getContextPath
Do you have a test.xml lurking around in conf/[engine]/[host] in one of
them?  Would that test.xml have a  element with a docBase
pointing to ROOT/test?  If so, that's incorrect.


each webapps is independant my app is the ROOT directory now i define host 
like that :

appBase="/usr/local/tomcat5/webapps/users1"
appBase="/usr/local/tomcat5/webapps/users2"
each one have their own ROOT directory
but for the actual problem   i dont have any test.xml file or anything else 
on engine (or elsewhere that i can see)
both the 5.5.20 and 5.5.17 are new tomcat installed exactly the same way no 
docbase or anything else that i can see



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



RE: getContextPath

2006-10-31 Thread Caldarale, Charles R
> From: mast [mailto:[EMAIL PROTECTED] 
> Subject: Re: getContextPath
> 
> in the 5.5.17 version my app is under the ROOT directory yes 
> (that s the correct way like we told before no ?)

Depends on what you mean by "under".  If your app IS the ROOT directory,
then getContextPath() should return an empty string.  You cannot put one
webapp "under" another; each webapp is intended to be independent.

> my conf is the same for both :
>   appBase="/usr/local/tomcat5/webapps/users1" 
> unpackWARs="true"  autoDeploy="true" />
> for both the 5.5.20 and 5.5.17 so what can explain that the 
> variable aren't identical?

Do you have a test.xml lurking around in conf/[engine]/[host] in one of
them?  Would that test.xml have a  element with a docBase
pointing to ROOT/test?  If so, that's incorrect.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

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



Re: getContextPath

2006-10-31 Thread mast
in the 5.5.17 version my app is under the ROOT directory yes (that s the 
correct way like we told before no ?)

to give another example with exactly the same deployement (both under ROOT)
with a 5.5.17 and a 5.5.20
5.5.17 :
ContextPath: /test
ServletPath: /test.jsp
PathInfo: null
RequestURI: /test/test.jsp

5.5.20
ContextPath:
ServletPath: /test/test.jsp
PathInfo: null
RequestURI: /test/test.jsp


so exactly the same problem that between the 5.5.9 and 5.5.17
both the 5.5.9 and 5.5.20 appear to work in the "good" way but the 5.5.17 
still has the same problem

my conf is the same for both :
unpackWARs="true"  autoDeploy="true" />
for both the 5.5.20 and 5.5.17 so what can explain that the variable aren't 
identical?



- Original Message - 
From: "Caldarale, Charles R" <[EMAIL PROTECTED]>

To: "Tomcat Users List" 
Sent: Tuesday, October 31, 2006 9:14 PM
Subject: RE: getContextPath



From: mast [mailto:[EMAIL PROTECTED]
Subject: Re: getContextPath

i use a simple jsp file with :
ContextPath:  <%= request.getContextPath() %>
ServletPath:  <%= request.getServletPath() %>

with a 5.5.9 server
ContextPath: /test
ServletPath: /test.jsp

with a 5.517 server
ContextPath:
ServletPath: /test/test.jsp


Did you change how the app was deployed between 5.5.9 and 5.5.17?  It
appears that in your 5.5.17 version, your app is under the ROOT
directory, rather than under your 's appBase.

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

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



RE: getContextPath

2006-10-31 Thread Caldarale, Charles R
> From: mast [mailto:[EMAIL PROTECTED] 
> Subject: Re: getContextPath
> 
> i use a simple jsp file with :
> ContextPath:  <%= request.getContextPath() %>
> ServletPath:  <%= request.getServletPath() %>
>
> with a 5.5.9 server
> ContextPath: /test
> ServletPath: /test.jsp
> 
> with a 5.517 server
> ContextPath:
> ServletPath: /test/test.jsp

Did you change how the app was deployed between 5.5.9 and 5.5.17?  It
appears that in your 5.5.17 version, your app is under the ROOT
directory, rather than under your 's appBase.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

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



Re: getContextPath

2006-10-31 Thread mast

i use a simple jsp file with :
ContextPath:  <%= request.getContextPath() %>
ServletPath:  <%= request.getServletPath() %>

- Original Message - 
From: "Caldarale, Charles R" <[EMAIL PROTECTED]>

To: "Tomcat Users List" 
Sent: Tuesday, October 31, 2006 8:11 PM
Subject: RE: getContextPath


From: mast [mailto:[EMAIL PROTECTED] 
Subject: Re: getContextPath


with a 5.5.9 server
ContextPath: /test
ServletPath: /test.jsp

with a 5.517 server
ContextPath:
ServletPath: /test/test.jsp


What APIs are you using to determine ContextPath and ServletPath?

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

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



RE: getContextPath

2006-10-31 Thread Caldarale, Charles R
> From: mast [mailto:[EMAIL PROTECTED] 
> Subject: Re: getContextPath
> 
> with a 5.5.9 server
> ContextPath: /test
> ServletPath: /test.jsp
> 
> with a 5.517 server
> ContextPath:
> ServletPath: /test/test.jsp

What APIs are you using to determine ContextPath and ServletPath?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

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



Re: getContextPath

2006-10-31 Thread mast

Well i have try with a valid configuration and i still get the same problem

with a 5.5.9 server
ContextPath: /test
ServletPath: /test.jsp
PathInfo: null
RequestURI: /test/test.jsp
QueryString: null

with a 5.517 server
ContextPath:
ServletPath: /test/test.jsp
PathInfo: null
RequestURI: /test/test.jsp
QueryString: null

- Original Message - 
From: "mast" <[EMAIL PROTECTED]>

To: "Tomcat Users List" 
Sent: Monday, October 30, 2006 12:31 AM
Subject: Re: getContextPath



>

There was a change at some point that resulted in any directory under
the webapps directory being deployed as an application. You would see
this behaviour if you had configured a host appBase to be the same as
a context docBase - a configuration that is invalid.

Mark

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




Hmm i understand but this configuration was invalid in 5.5.9 too so they 
did some change no ?


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



Re: getContextPath

2006-10-29 Thread Mark Thomas
mast wrote:
> Hmm i understand but this configuration was invalid in 5.5.9 too so they
> did some change no ?

This configuration has always been invalid but if you use it then you
will see different behaviour as a side-effect of adding the deploy any
directory in appBase feature which is new.

Mark


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



Re: getContextPath

2006-10-29 Thread mast


There was a change at some point that resulted in any directory under
the webapps directory being deployed as an application. You would see
this behaviour if you had configured a host appBase to be the same as
a context docBase - a configuration that is invalid.

Mark

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




Hmm i understand but this configuration was invalid in 5.5.9 too so they did 
some change no ? 



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



Re: getContextPath

2006-10-29 Thread Mark Thomas
mast wrote:
> with two server.xml identical with a test.jsp on a directory test on 5.5.9
> TranslatedPath: null
> ContextPath: ServletPath: /test/test.jsp
> PathInfo: null
> RequestURI: /test/test.jsp
> QueryString: null
> 
> on 5.5.20
> 
> ContextPath: /test
> ServletPath: /test.jsp
> PathInfo: null
> RequestURI: /test/test.jsp
> QueryString: null

There was a change at some point that resulted in any directory under
the webapps directory being deployed as an application. You would see
this behaviour if you had configured a host appBase to be the same as
a context docBase - a configuration that is invalid.

Mark

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



Re: getContextPath

2006-10-29 Thread mast


Examples please. I suspect it is as a result of the configuration
changes you have been making.

Mark


with two server.xml identical with a test.jsp on a directory test 
on 5.5.9

TranslatedPath: null
ContextPath: 
ServletPath: /test/test.jsp

PathInfo: null
RequestURI: /test/test.jsp
QueryString: null

on 5.5.20

ContextPath: /test
ServletPath: /test.jsp
PathInfo: null
RequestURI: /test/test.jsp
QueryString: null


like you can see the servletpath and contextpath is different

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



Re: getContextPath

2006-10-29 Thread Mark Thomas
mast wrote:
> i return with my first problem :=20
> in a tomcat 5.5.9 when i use the  request.getServletPath() and=20
> request.getContextPath()
> i get different answer than a tomcat 5.5.19 (or 20), has this function=20
> change in the new tomcat?

Examples please. I suspect it is as a result of the configuration
changes you have been making.

Mark


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