users@servlet-spec.java.net

[servlet-spec users] [jsr369-experts] Re: Re: [126-onStartupWebXmlVersionLevel] Discussion

From: 정의근 <Eugene>
Date: Mon, 23 Feb 2015 17:22:50 +0900

Hello,


Basically, I agree with Mark.
But I don't prefer the way to turn on/off searching
ServletContainerInitializers based on the web.xml version.
.

I think it can be compatibility problem in two aspects.

1. When a developer changes the web.xml version from 2.5 to 3.0,
ServletContainerInitializers are called undesirably.

2. When the developer chooses to deploy the web module to the WAS which
supports 3.0,
ServletContainerInitializers are also called undesirably.


So it would help users/developers if they can turn on/off searching
ServletContainerInitializers.
Our implementation provides that option for each web module level.



Best regards,
Eugene Chung (Korean : 정의근)

On Sat, Feb 21, 2015 at 10:51 PM, Mark Thomas <markt_at_apache.org> wrote:

> On 21/02/2015 00:06, Edward Burns wrote:
> > Hello Volunteers,
> >
> > I'm observing some inconsistent behavior between GlassFish and WLS on
> > this point and I wonder what you all are doing in your respective
> > containers. Here's the scoop. Apologies if I'm missing something
> > fundamental here.
> >
> > I have a web module with a ServletContainerInitializer impl within it.
> > I observe that the onStartup() method gets called just fine in GlassFish
> > 4.1 regardless of if the web.xml has 2.5 or 3.0, but on WLS, it has to
> > be 3.0 for it to be called.
> >
> > Do we need something in the spec that requires onStartup() to be called
> > if present regardless of the version level?
>
> There was a similar discussion previously regarding annotation scanning
> that resulted in the text at 1.6.1 being added.
>
> From the point of view of consistency I'd say GlassFish is doing what
> the spec intended and WLS is not.
>
> Tomcat, like GlassFish, always scans for SCIs regardless of version.
>
> For the record, I'd like to repeat my previously stated view that I
> think this behaviour is wrong. It means that an app that behaves one way
> on a Servlet 2.5 container may behave completely differently on a
> Servlet 3.0 container because a bundled library uses annotations and/or
> SCIs. Given J2EE's strong views on backwards compatibility this is not
> what a user is going to expect.
>
> So, while it looks like WLS is breaking the spec, I much prefer that
> solution: Servlet X pluggability features should only be enabled with a
> Servlet X or later web.xml. Unfortunately, I think the time has long
> since passed to change this without creating a whole bunch of different
> backward compatibility issues.
>
> Mark
>
>