Mark,
See comments in-line -
On 6/8/12 10:16 AM, Mark Thomas wrote:
> On 08/06/2012 00:59, Rajiv Mordani wrote:
>> Like Bill pointed out in the thread - there are some exceptions to the
>> rule. This is one of the exceptions where metadata-complete does not
>> disable scanning of ServletContainerInitializers and related annotations
>> (HandlesTypes) bundled with the application. This was one of the key
>> pluggability contracts that was added in Servlet 3.0.
>
> So I take it then that your view is that it is acceptable for a web
> application written to the 2.5 API that runs one way on a 2.5 container
> to run differently on a 3.0+ container due to 3rd party libraries using
> 3.0+ annotations?
If it was written to a 2.5 API - the library probably never used the
servlet 3.0 annotations either. So when the application moves to a 3.0
container - at a minimum the library will have to be updated if they
want to use that. So the argument that the behavior is going to be
different does not really make sense.
>
> I do not find this at all acceptable. It breaks the principle of least
> surprise. However, I suspect based on what has already been said that I
> am not going to win this argument. On that basis I believe we need to do
> the following:
>
> 1. Correct the text of section 1.6.2 of the Servlet 3.0 specification to
> make clear that some annotations (define which ones) will always be
> scanned for regardless of the setting of meta-data complete.
We can do that - the only annotation is HandlesTypes AFAIK.
>
> 2. Add a clear warning to this section that applications written to
> previous specification versions may behave differently on new containers
> due to the presence of annotations (e.g. in third party libraries).
Again - going forward that *may* be true but the argument from 2.5 to
3.0 does not hold true. Am not sure that it warrants a warning that
applications may behave differently however if we have the text that
says that says some annotations are scanned I think that is good enough.
We will work on the text needed to clarify the issue.
- Rajiv
>
> Mark
>
>
>> - Rajiv
>>
>>
>> On 6/1/12 12:07 PM, Mark Thomas wrote:
>>> On 25/05/2012 09:22, Jan Bartel wrote:
>>>> Rajiv,
>>>>
>>>> On 24 May 2012 23:59, Rajiv Mordani<rajiv.mordani_at_oracle.com> wrote:
>>> <snip/>
>>>
>>>>> The application would explicitly use an annotation in the code - so the
>>>>> behavior will be expected by the application by the fact that it
>>>>> used the
>>>>> particular annotation.
>>>> Not necessarily. As per http://java.net/jira/browse/SERVLET_SPEC-36, a
>>>> servlet 3.0 container is required to look for
>>>> ServletContextInitializers inside WEB-INF/lib jars. If an application
>>>> uses a jar that happens to have one of these then when the app is
>>>> deployed on a 2.5 compliant container it may have different and
>>>> unexpected behaviour on a servlet 3.0 container. Unless a user sees
>>>> the source of all the jars in WEB-INF/lib there's no way for them to
>>>> know that such annotations are present.
>>> Ping.
>>>
>>> I have yet to see a response to this particular point.
>>>
>>> And the same point applies to all the other new 3.0 annotations if
>>> meta-data complete is not specified.
>>>
>>> I understand why the specification is written the way it is but the
>>> above is one of the less pleasant side-effects. Is this really the way
>>> we want to go?
>>>
>>> Mark