Configuring Web Application Deployment Descriptors
See Also
Deployment descriptors are XML-based text files whose elements describe how to assemble and
deploy a module to a specific environment. The elements also contain behavioral information
about components not included directly in code.
For web applications, there are three types of deployment descriptors:
-
web.xml. The general web application deployment descriptor that configures
deployment settings for components belonging to a web application, such as servlets and JSP
files.
-
sun-web.xml. The server-specific deployment descriptor that configures
deployment settings for the Glassfish application server.
-
context.xml.The server-specific deployment descriptor that configures
deployment settings for the Tomcat Web Server.
To edit web.xml:
-
In the Projects window, expand the Configuration Files node for your web application
project.
-
Double-click web.xml to open it in the web.xml Visual Editor.
The web.xml Visual Editor opens in a Source Editor tab. The editor contains an
Overview section and a section for most of the elements in the web.xml file.
-
Edit the deployment descriptor as necessary. See the following topics for more information:
-
-
(Optional) Click XML at the top of the web.xml Visual Editor to view and edit the
deployment descripor's XML code.
-
Choose File > Save to save your changes.
To edit sun-web.xml:
-
In the Projects window, expand the Configuration Files node for your web application
project.
-
Double-click sun-web.xml to open it in the graphical editor.
The graphical editor opens in a Source Editor tab. The editor contains a tree view of the
module's contents on the left and property editors for each item on the right.
-
Edit the deployment descriptor as necessary. See the following topics for more information:
-
Choose File > Save to save your changes.
-
If you enter any XML syntax errors the IDE automatically alerts you. To fully ensure your
changes have not cause any errors, you should verify the web application.
To edit context.xml:
-
In the Projects window, expand the Configuration Files node for your web application
project.
-
Double-click context.xml to open it in the graphical editor.
The graphical editor opens in a Source Editor tab. The editor contains a tree view of the
module's contents on the left and property editors for each item on the right.
-
Edit the deployment descriptor as necessary.
-
Choose File > Save to save your changes.
-
If you enter any XML syntax errors the IDE automatically alerts you. To fully ensure your
changes have not cause any errors, you should verify the web application.
-
See Also
-
About Deployment Descriptors
-
Configuring EJB Deployment Descriptors
-
Registering a Filter
-
Registering a Web Application
Listener
Legal Notices