2015-02-23 20:32 GMT+01:00 Konstantin Kolinko <knst.koli...@gmail.com>:

> If ServletContext.getContext(String) is actually supposed to perform
> prefix-mapping, then it explains why getContext("/ROOT") worked for
> you.
>
> getContext("/ROOT") worked just because getContext("/foobar") returns
> the ROOT context when there is no "foobar" application.  There is
> nothing special in the name "/ROOT" here.  Your "issue 1" and "issue
> 2" are the same.
>
> 1. I think this needs an issue in Bugzilla for Tomcat 7.
>
> 2. I think this needs a clarification from Servlet EG at least to fix
> their Javadoc. [1]
>
> I agree the API is bad in the end, you don't really know which context is
being returned. For example if the context you're requesting is not
deployed, you'll get the root context and a random error when using it.

Rémy

Reply via email to