Creating web.xml
A web.xml file contains the standard J2EE configuration
options for the web application. JDeveloper also automatically generates a web.xml
file when you create a deployment profile for
web applications (WAR) or when running the wizards to create the various
web application clients such as a servlets, JSPs, or Struts components in JDeveloper.
However, if you want to control the contents of the web.xml
, you
can manually create your own web.xml
to include in the deployment
profile as follows.
Note: If this item appears dimmed or grayed out, this indicates
that there is a web.xml
deployment descriptor already created in
the project. You can have only one of each deployment descriptor type per project.
To create a web.xml file:
- In the Navigator, select the
project
to which you want to add an web.xml
file.
- Choose File | New to open the
New Gallery dialog.
- In the Categories tree, expand General
and select Deployment Descriptors.
- In the Items list, double-click Web
Deployment Descriptor (web.xml).
- Click OK.
- The newly created file opens in the Code Editor. Edit this file to add the
configuration settings as appropriate.
- (Optional) If you ever want to edit this deployment descriptor
in the Web Application Deployment Descriptor panel,
right-click the
web.xml node in the Navigator below the specified project and choose
Settings. See Editing
Deployment Descriptors.
- (Optional) If you want to create a J2EE web module deployment profile,
right-click the
web.xml
node in the Navigator below the specified project and choose
Create WAR Deployment Profile.
Notes:
- You can also create the web.xml file, by selecting this item from the Web
Tier category in the New Gallery.
- See the Sun Microsystems Java Servlet Specification, Version 2.3 which you
can download from:
http://www.javasoft.com/products/servlet/
- Make sure that the web application deployment descriptor is located inside
the web archive (WAR) file
WEB-INF/web.xml
.