background image

Using Annotations

<< Securing Containers | Using Programmatic Security >>
<< Securing Containers | Using Programmatic Security >>

Using Annotations

This tutorial does not document how to write the deployment descriptors from scratch, only
what configurations each example requires its deployment descriptors to define. For help with
writing deployment descriptors, you can view the provided deployment descriptors in a text
editor. Each example's deployment descriptors are stored at the top layer of each example's
directory. Another way to learn how to write deployment descriptors is to read the specification
in which the deployment descriptor elements are defined.
Deployment descriptors must provide certain structural information for each component if this
information has not been provided in annotations or is not to be defaulted.
Different types of components use different formats, or schema, for their deployment
descriptors. The security elements of deployment descriptors which are discussed in this
tutorial include the following:
Enterprise JavaBeans components use an EJB deployment descriptor that must be named
META-INF/ejb-jar.xml
and must be contained in the EJB JAR file.
The schema for enterprise bean deployment descriptors is provided in the EJB 3.0
Specification (JSR-220), Chapter 18.5, Deployment Descriptor XML Schema, which can be
downloaded from
http://jcp.org/en/jsr/detail?id=220
.
Security elements for EJB deployment descriptors are discussed in this tutorial in the section
"Using Enterprise Bean Security Deployment Descriptor Elements" on page 816
.
Web Services components use a jaxrpc-mapping-info deployment descriptor defined in
JSR 109. This deployment descriptor provides deployment-time mapping functionality
between Java and WSDL. In conjunction with JSR 181, JAX-WS 2.0 complements this
mapping functionality with development-time Java annotations that control mapping
between Java and WSDL.
The schema for web services deployment descriptors is provided in Web Services for Java
EE (JSR-109), section 7.1, Web Services Deployment Descriptor XML Schema, which can be
downloaded from
http://jcp.org/en/jsr/detail?id=109
.
Schema elements for web application deployment descriptors are discussed in this tutorial
in the section
"Declaring Security Requirements in a Deployment Descriptor" on page 851
.
Web components use a web application deployment descriptor named web.xml.
The schema for web component deployment descriptors is provided in the Java Servlet 2.5
Specification (JSR-154), section SRV.13, Deployment Descriptor, which can be downloaded
from
http://jcp.org/en/jsr/detail?id=154
.
Security elements for web application deployment descriptors are discussed in this tutorial
in the section
"Declaring Security Requirements in a Deployment Descriptor" on page 851
.
Using Annotations
Annotations enable a declarative style of programming, and so encompass both the declarative
and programmatic security concepts. Users can specify information about security within a
Securing Containers
Chapter 28 · Introduction to Security in the Java EE Platform
775