uCosminexus Application Server, API Reference Guide

[Contents][Index][Back][Next]

2.1.2 Scope of support for the annotations included in the javax.annotation.security package

This subsection describes the applicability of annotations included in the javax.annotation.security package. The following sections describe the annotations that you can code in each component:

Organization of this subsection
(1) WAR File (Servlet 3.0 compliant)
(2) WAR file (Supported by Servlet 2.5)
(3) EJB-JAR file (EJB3.1/EJB3.0 compliant)
(4) Library JAR file (Servlets or JSPs)
(5) Library JAR file (Enterprise Bean, exception class, or other classes)

(1) WAR File (Servlet 3.0 compliant)

The following table lists the annotations that you can code in a WAR file.

Table 2-6 Annotations (javax.annotation.security package) that can be coded in WAR file (Servlet 3.0 compliant).

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
@DeclareRoles Y Y Y -- Y -- -- -- -- -- -- -- --
@RunAs Y N -- -- -- -- -- -- -- -- -- -- --

Legend:
Y: Supported.
N: Not supported by Application Server.
--: Not supported by standard specifications.

(2) WAR file (Supported by Servlet 2.5)

The following table lists the annotations that you can code in a WAR file:

Table 2-7 Annotations (javax.annotation.security package) that can be coded in a WAR file (Supported by Servlet 2.5)

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
@DeclareRoles Y -- -- -- -- -- -- --
@RunAs Y Y Y -- -- -- -- --

Legend:
Y: Supported.
--: Not applicable.

(3) EJB-JAR file (EJB3.1/EJB3.0 compliant)

The following table lists the annotations that you can code in an EJB-JAR file:

Table 2-8 Annotations (javax.annotation.security package) that can be coded in an EJB-JAR file (EJB3.1/EJB3.0 compliant)

Annotation name Enterprise Bean Exception class Other class
Interface Session Bean Entity Bean Message-driven Bean Interceptor
Other than the default interceptor Default interceptor
@DeclareRoles -- Y -- N -- -- -- --
@DenyAll -- Y -- N -- -- -- --
@PermitAll -- Y -- N -- -- -- --
@RolesAllowed -- Y -- N -- -- -- --
@RunAs -- Y -- N -- -- -- --

Legend:
Y: Supported.
N: Not supported by Application Server.
--: Not applicable.

(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:

Table 2-9 Annotations (javax.annotation.security package) that can be coded in a library JAR file (Servlets or JSPs)

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
@DeclareRoles -- -- Y -- Y -- -- -- -- --

Legend:
Y: Supported.
--: Not applicable.

(5) Library JAR file (Enterprise Bean, exception class, or other classes)

You cannot use the annotations in the Enterprise beans, exception classes, or the other classes of a library JAR file.