users@servlet-spec.java.net

[servlet-spec users] Re: [jsr369-experts] Re: SERVLET_SPEC-137: Allow context root

From: Mark Thomas <markt_at_apache.org>
Date: Wed, 2 Sep 2015 08:12:41 +0100

On 01/09/2015 20:50, arjan tijms wrote:
> Hi,
>
> On Tue, Sep 1, 2015 at 8:19 PM, Mark Thomas <markt_at_apache.org> wrote:
>> As I have said previously on this thread, web applications are meant to
>> be independent of the context path at which they are deployed. Anything
>> that encourages web application developers to think that they can code
>> to a specific context path is a bad idea.
>
> There is one specific case to consider that's maybe a bit different;
> but for automated tests like happen in the Java EE 7 samples project
> as well as the Mojarra test suite, one builds hundreds of wars and
> dynamically (e.g. via Arquillian or Cargo) deploys these against a
> range of different servers. The test code (which runs outside the
> container) then has to know the URL at which each war was deployed.
>
> This is probably much more straightforward if the context root was
> known by each test in advance. Mojarra now uses glassfish-web.xml for
> this, so the test suite can't easily be run against other servers. See
> e.g. https://github.com/omnifaces/mojarra/blob/master/test/javaee8/facelets/src/main/webapp/WEB-INF/glassfish-web.xml

In this case - much as with the TCK - I'd expect there to be a small
container specific module in the testsuite to handle deployment that
ensured the WAR was deployed to the expected context path.

Mark