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:

  1. In the Navigator, select the project_iconproject to which you want to add an web.xml file.
  2. Choose File | New to open the New Gallery dialog.
  3. In the Categories tree, expand General and select Deployment Descriptors.
  4. In the Items list, double-click Web Deployment Descriptor (web.xml).
  5. Click OK.
  6. The newly created file opens in the Code Editor. Edit this file to add the configuration settings as appropriate.
  7. (Optional) If you ever want to edit this deployment descriptor in the Web Application Deployment Descriptor panel, right-click the webxmlicon web.xml node in the Navigator below the specified project and choose Settings. See Editing Deployment Descriptors.
  8. (Optional) If you want to create a J2EE web module deployment profile, right-click the webxmlicon web.xml node in the Navigator below the specified project and choose Create WAR Deployment Profile.

Notes: