Mark,

On 3/17/16 1:28 PM, Mark Thomas wrote:
> On 17 March 2016 16:06:10 GMT+00:00, Paul Benedict <pbened...@apache.org> 
> wrote:
>> This question is not about Tomcat per se, but it does affect it. It's
>> really about the EE specification in regards to any servlet container.
>> I'd
>> like to get professional opinions on this part of the specification.
>>
>> I am quoting from EE 5.0 (see link below), section 8.3.1, paragraph 3c:
>>
>> The Deployer must... "Assign a context root for each web module
>> included in
>> the Java EE application. The context root is a relative name in the web
>> namespace for the application. Each web module must be given a distinct
>> and
>> non-overlapping name for its context root."
>>
>> So given this scenario:
>> /context/something <-- context is /context
>> /context/something/somethingelse <-- context is /context/something
>>
>> The specification puts no limitations on the context root character set
>> (so
>> it can include a slash). With that said, would you consider these
>> "overlapping" contexts? I noticed one application server supporting
>> this
>> paradigm without issue, but it seems like a violation of the
>> specification.
>> Please advise.
>>
>> Also, since Tomcat doesn't support "applications" (EAR?), how should
>> the
>> specification be interpreted in the absence of that artifact?
>>
>> [1]
>> http://download.oracle.com/otndocs/jcp/javaee-5.0-fr-eval-oth-JSpec/
>>
>> Cheers,
>> Paul
> 
> That requirement makes no sense as I understand it. You always have 
> overlapping context paths because of the ROOT context.
> 
> I think this is one for the EG to clarify what they meant.
> 
> It is also worth noting that the servlet spec explicitly states thst
> requests are matched against the longest matching context path.

How can Tomcat tell the difference between requests to:

/webappA/someresource/foo (which does exist in webappA path=/webappA)
and
/webappA/someresource/foo (which does not exist in webappB
path="/webappA/someresource)

In the above case, Tomcat should choose the second, because
/webappA/someresource matches webappB's context path, which is longer
than webappA's context path, right?

(This is yet another reason why confusing URL prefixes should be avoided
whenever possible.)

-chris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to