jsr340-experts@servlet-spec.java.net

[jsr340-experts] About SERVLET_SPEC-36

From: Shing Wai Chan <shing.wai.chan_at_oracle.com>
Date: Mon, 30 Jul 2012 15:21:33 -0700

I am looking at issue http://java.net/jira/browse/SERVLET_SPEC-36
("Clarify relationship of metadata-complete and
ServletContainerInitializers")

The metadata-complete=true means the completeness of data specified in
deployment descriptor.
But it does not mean the annotation will be ignored in the given
application.
For instance, CDI annotations will still be scanned and processed.

The ServletContainerInitializer is a service provider specified in
META-INF/services, not by annotation. In a ServletContainerInitializer,
there may be a @HandlesTypes, which does not have corresponding metadata
in deployment descriptor. Since a ServletContainerInitializer and
@HandlesTypes work together, it should be interpreted whenever a
ServletContainerInitializer is loaded.

In section 8.2.4 of Servlet 3.0,
"In addition to the ServletContainerInitializer we also have an
annotation - HandlesTypes. The annotation will be applied on the
implementation of ServletContainerInitializer to express interest in
classes that are either annotated with the classes specified in the
value or if a class extends / implements one of those classes anywhere
in the classes super types."

I propose the following clarification in wording:
"In addition to the ServletContainerInitializer we also have an
annotation - HandlesTypes. The annotation will be applied on the
implementation of ServletContainerInitializer*, independent of
metadata-complete,* to express interest in classes that are either
annotated with the classes specified in the value or if a class extends
/ implements one of those classes anywhere in the classes super types."

Shing Wai Chan