12.2.1 Merits of using annotations and the annotations that can be specified

This subsection describes the merits of using annotations and the annotations that can be specified.

Organization of this subsection
(1) Merits of using annotations
(2) Annotations that can be specified in a Web application
(3) Annotations that can be specified in the Enterprise Beans

(1) Merits of using annotations

The merits of using annotations are as follows:

For details on the DI, see 12.4 Using the DI.

(2) Annotations that can be specified in a Web application

Annotations can be specified in the Web applications for Servlet 2.4, Servlet 2.5, or Servlet 3.0. However, the annotations that can be specified depend on the Servlet version.

For details on the annotations that can be specified, see 2.1 Range of supported annotations in the uCosminexus Application Server API Reference Guide.

For details on the types of resources that you can specify in the @Resource annotation, see 12.4.1 Types of resources that can be specified in the @Resource annotation. Also, the name attribute of the @EJB and @Resource annotations corresponds to the tag elements of web.xml. For details on the mapping, check the standard specifications.

Hint
Note that for web.xml of Servlet version 2.3 or earlier, specification of annotations is disabled.

(3) Annotations that can be specified in the Enterprise Beans

Annotations can be specified in the Enterprise Beans for EJB 3.0.

For details on the annotations that can be specified, see 2.1 Range of supported annotations in the uCosminexus Application Server API Reference Guide.

Note that when the home interface is specified by using the @RemoteHome or @LocalHome annotation, the return value of the create method of the specified home interface is considered as the component interface.