On 30/11/2012 19:33, Jitendra Kotamraju wrote:
> On 11/30/2012 12:49 AM, Mark Thomas wrote:
>>
>> Long version:
>> metadata-complete controls whether or not a Servlet container scans
>> JARs for Servlet annotations (Servlets, Filters and Listeners). The
>> mechanism by which other components can scan for classes of interest
>> is the @HandlesTypes annotation on a ServletContextInitializer (SCI).
>> metadata-complete has no impact on SCI processing. If we take the
>> approach suggested above we would have to package our own class
>> scanning within the WebSocket JAR.
>>
> I think that is incorrect. metadata-complete impacts SCI processing. It
> impacts the complete scanning of *all* annotations not just servlet
> annotations.
Your thinking is wrong and I am speaking with my Servlet 3.1 EG member
hat on.
metadata-complete has no impact on SCI processing. See
http://java.net/jira/browse/SERVLET_SPEC-36.
The short-version:
metadata-complete controls scanning for the Servlet/Filter/Listener
annotations.
SCIs are controlled by fragment ordering. Only fragments included in the
order are scanned for SCIs and only fragments included in the order are
then scanned for matches to any @HandlesTypes.
While the wording of the Servlet 3.0 specification was far from clear,
the recent discussion around SERVLET_SPEC-36 has clarified what the
Servlet 3.0 EG intended. This clarification will be in the 3.1 spec (and
I hope back-ported to the 3.0 spec)
Mark