Work with Web Application Deployment Descriptor using web.xml editor

Configuring Web applications using the Web deployment descriptor editor

When you create a Web project, the New Web Project wizard places a web.xml file in the project's WEB-INF directory. To open the web.xml file, double-click the Web Deployment Descriptor file in the J2EE Navigator view. The Web deployment descriptor editor opens in the editing pane.

It is recommended that you use the tabbed pages (views) to construct the deployment descriptor for your Web application. Even though the Web deployment descriptor editor does provides a source page of the web.xml file (from the Source tab), using the tabbed pages is easier and introduces fewer errors. As you make changes on these tabbed pages, the web.xml file is updated automatically. For instance, when you use the New Servlet wizard to create a servlet in a Web project, the appropriate servlet entry is automatically inserted into the web.xml file.

In addition to the configuration information in the web.xml file, you can also use this editor to edit other deployment descriptors in the Web project, including information on bindings and IBM extensions (ibm-web-bnd.xmi and ibm-web-ext.xmi files).

To edit the deployment descriptor, click the tabbed pages to locate attributes that you wish to add, edit or remove. In addition, the sections in the Overview page contain links to existing elements of the deployment descriptor. Click the links to open the appropriate editor page to make updates or additions.

For help on individual attributes represented by fields and other controls in the editor, click F1.

The Web deployment descriptor editor

The Web deployment descriptor editor lets you specify deployment information for modules created in the Web development environment. The information appears in the WEB-INF/web.xml file. Note that you use the Web deployment descriptor to set deployment descriptor attributes. You do not use it to manipulate Web resource content.

The web.xml file for a Web project provides information necessary for deploying a Web application module. It is used in building a WAR file from a project. Whenever you create a new Web project, a minimal web.xml file is automatically created in WEB-INF under the project's Web content folder.

The Web deployment descriptor editor is dynamic and includes many tabbed pages (views) that represent various properties and settings in the deployment descriptor. For example, you can click the Servlets tab to display the Servlets and JSPs page. From this page, you can add or remove servlets and JSPs Web application. The Web deployment descriptor editor includes the following tabbed pages, each of which you can edit:

Editing the XML source directly is not the recommended method for editing the deployment descriptor. The best way to build deployment descriptor files is to edit the multiple tabbed pages. As you specify deployment information in these tabbed pages, the editor automatically incorporates the appropriate XML tagging.

In addition to the configuration information in the web.xml file, other deployment descriptors in a Web project include the following information:

If you import a WAR file into an existing Web project, you can include the deployment descriptor files included in the WAR file as the Web project's new deployment descriptor. Any specific deployment information already defined in these files is used when deploying the updated Web application.

The web.xml file can be updated automatically to reflect changes to your Web project. For instance, when you use the New Servlet wizard to create a new servlet in a Web project, the wizard places the appropriate servlet entry into the web.xml file.

Professional hosting     Belorussian informational portal         Free SCWCD 1.4 Study Guide     Free SCBCD 1.3 Study Guide     Free SCDJWS 1.4 Study Guide     SCDJWS 1.4 Quiz     IBM Test 000-287. Enterprise Application Development with IBM WebSphere Studio, V5.0 Study Guide     Free Mock Exam Engine