An enterprise application generally includes two types of . In Java EE 5 and 6 enterprise applications, the descriptor files are optional and
you can use annotations to specify most deployment settings and resources.
J2EE 1.4 enterprise applications will generally require the following descriptor files.
A general J2EE deployment descriptor that configures deployment settings
on any J2EE-compliant implementation. It describes the enterprise application,
which components it uses, how the components relate to each other, and which
resources they use. The general enterprise application deployment descriptor
is called application.xml.
A server-specific deployment descriptor that configures deployment settings
for the application server to which you are deploying.
If you are deploying your application to the Sun Java System Application Server or GlassFish,
the IDE provides a graphical deployment descriptor editor
and automatically updates the deployment descriptor as you edit your files.
For all other application servers, you have to write the server-specific deployment
descriptors yourself.
Entries in these files are automatically generated when you
add a module to the enterprise application.
Both deployment descriptors are XML files that are stored in
the enterprise application's META-INF folder. You can edit both
files in the Source Editor. The sun-application.xml file can also
be edited in a visual editor, as described below.
To edit an enterprise application's deployment descriptors:
In the Projects window, locate the project and expand its
Configuration Files node. Alternatively, in the Files window,
expand the project's src/conf subfolder.
Double-click the node to open the file. The glassfish-application.xml file opens
in the glassfish-application.xml Visual Editor.
To open it in the Source Editor,
right-click it in the Projects window and choose Edit.
Edit the elements. You can use code completion features in the Source Editor
to ensure that the elements are syntactically correct.
(Optional) Right-click in the Source Editor and choose Validate from the
contextual menu to verify that the document follows the XML schema for web
deployment descriptors.
If you have a Java EE 5 or Java EE 6 enterprise application that is deployed to a Java EE container,
you can specify most deployment settings using annotations.
However, you have the option of using XML descriptors as an alternative to annotations
or to supplement or override some annotations.