9.22.1 Annotations that depend on the JPA Provider
This point describes the applicability of the annotations that depend on the JPA Provider. The annotations that can be coded in each component are as follows:
- Organization of this subsection
(1) WAR file (Servlet 3.0 compliant)
The following table lists the annotations that you can code in a WAR file:
Annotation name |
Servlet specifications |
JSP specifications |
Exception class |
ManagedBean (JSF) |
Other class |
||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Servlet |
Servlet (API) |
Servlet filter |
Servlet filter (API) |
Event listener |
Event listener (API) |
JSP FILE |
Tag handler |
Tag library event listener |
|||||
Classic tag handler |
Simple tag handler |
||||||||||||
Y |
-- |
Y |
-- |
Y |
-- |
-- |
Y |
Y |
N |
-- |
Y |
-- |
|
Y |
-- |
Y |
-- |
Y |
-- |
-- |
Y |
Y |
N |
-- |
Y |
-- |
|
Y |
-- |
Y |
-- |
Y |
-- |
-- |
Y |
Y |
N |
-- |
Y |
-- |
|
Y |
-- |
Y |
-- |
Y |
-- |
-- |
Y |
Y |
N |
-- |
Y |
-- |
|
Y |
-- |
Y |
-- |
Y |
-- |
-- |
Y |
Y |
N |
-- |
Y |
-- |
(2) WAR file (Supported by Servlet 2.5)
The following table lists the annotations that you can code in a WAR file:
Annotation name |
Servlet specifications |
JSP specifications |
Other class |
|||||
---|---|---|---|---|---|---|---|---|
Servlet |
Servlet filter |
Event listener |
JSP file |
Tag handler |
Tag library event listener |
|||
Classic tag handler |
Simple tag handler |
|||||||
Y |
Y |
Y |
-- |
Y |
Y |
N |
-- |
|
Y |
Y |
Y |
-- |
Y |
Y |
N |
-- |
|
Y |
Y |
Y |
-- |
Y |
Y |
N |
-- |
|
Y |
Y |
Y |
-- |
Y |
Y |
N |
-- |
|
Y |
Y |
Y |
-- |
Y |
Y |
N |
-- |
(3) EJB-JAR file (EJB3.1/EJB3.0 compliant)
The following table lists the annotations that you can code in an EJB-JAR file:
Annotation name |
Enterprise Bean |
Exception class |
Other class |
|||||
---|---|---|---|---|---|---|---|---|
Interface |
Session Bean |
Entity Bean |
Message-driven Bean |
Interceptor |
||||
Other than default Interceptor |
Default Interceptor |
|||||||
-- |
Y |
-- |
N |
Y |
Y |
-- |
-- |
|
-- |
Y |
-- |
N |
Y |
Y |
-- |
-- |
|
-- |
Y |
-- |
N |
Y |
Y |
-- |
-- |
|
-- |
Y |
-- |
N |
Y |
Y |
-- |
-- |
|
-- |
Y |
-- |
N |
Y |
Y |
-- |
-- |
(4) Library JAR file (Servlets or JSPs)
The following table lists the annotations that you can code in a servlet or JSP of a library JAR file.
Annotation name |
Servlet specifications |
JSP specifications |
||||||||
---|---|---|---|---|---|---|---|---|---|---|
Servlet |
Servlet (API) |
Servlet filter |
Servlet filter (API) |
Event listener |
Event listener (API) |
JSP FILE |
Tag handler |
Tag library event listener |
||
Classic tag handler |
Simple tag handler |
|||||||||
-- |
-- |
Y |
-- |
Y |
-- |
-- |
Y |
Y |
N |
|
-- |
-- |
Y |
-- |
Y |
-- |
-- |
Y |
Y |
N |
|
-- |
-- |
Y |
-- |
Y |
-- |
-- |
Y |
Y |
N |
|
-- |
-- |
Y |
-- |
Y |
-- |
-- |
Y |
Y |
N |
|
-- |
-- |
Y |
-- |
Y |
-- |
-- |
Y |
Y |
N |
(5) Library JAR file (Enterprise Bean, exception class, or other classes)
The following table lists the annotations that you can code in the Enterprise Beans, exception classes, or the other classes of a library JAR file:
Annotation name |
Enterprise Bean |
Exception class |
||||
---|---|---|---|---|---|---|
Interface |
Session Bean |
Entity Bean |
Message-driven Bean |
Interceptor |
||
-- |
-- |
-- |
N |
Y |
-- |
|
-- |
-- |
-- |
N |
Y |
-- |
|
-- |
-- |
-- |
N |
Y |
-- |
|
-- |
-- |
-- |
N |
Y |
-- |
|
-- |
-- |
-- |
N |
Y |
-- |