tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Bug 57190] New: ServletContext.getContext(String) cannot return context when using parallel deployments
Date Wed, 05 Nov 2014 17:13:18 GMT

            Bug ID: 57190
           Summary: ServletContext.getContext(String) cannot return
                    context when using parallel deployments
           Product: Tomcat 7
           Version: 7.0.56
          Hardware: Macintosh
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina

When using ServletContext.getContext(String) in a parallel deployment the
context is not returned.

For example:
foo_a##001 and foo_b##001 are deployed.
Page on /foo_a/test.jsp calls ServletContext.getContext("/foo_b").  In non
parallel deployments this returns the ServletContext for "/foo_b". However in
parallel deployments the ServletContext for "/" is returned instead.

This was encountered using a custom filter that is set to forward certain
requests to files in one application to a central default application.

CrossContext is set to true for the context.xml.  This works as long as the
wars do not use the version name such as foo_b.war instead of foo_b##001.war.

I would expect ServletContext.getContext("/foo_b") to return the current active
context for a URL.  Instead it looks like it will require to specify the exact
version of a context instead such as ServletContext.getContext("/foo_b##001").  

This puts the burden of finding the active version of the context on the
calling application rather than the underlying servlet container to provide the
most current context when ServletContext.getContext(String) is referenced.

You are receiving this mail because:
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message