You can modify the web.xml
file and templates to customize feature sets, set properties, or to update servlet definitions and mappings.
This modification can be automated with a script when you publish to facilitate new applications.
web.xml template files
The following web.xml
template files are used in IBM® WebSphere® Portlet Factory.
Used in conjunction with wasce.web.xml on WebSphere Application Server Community Edition serversportlet.standard.web.xml
Used for Java Standard Portletsportlet.wpnative.web.xm
Used for IBM WebSphere Portal Native portlets (deprecated) standalone.web.xml
Used for standalone applications (non portlets)wasce.web.xml
Used for IBM WebSphere Application Server Community Edition standalone development applications
These files are stored in the WebContent\\WEB-INF\\bin\\deployment
folder. This allows for project unique user edits of the template for the project and for multiple targets (standalone and portal) from a single project. These files are included in the publishing archive during the publishing process.
The file standalone.web.xml
is stored in the WebContent\\WEB-INF\\bin\\deployment
folder. This allows for project unique user edits of the template for the project and for multiple targets (local and remote) from a single project. These files are included in the archive during the publishing process.
The WEB-INF\web.xml file
file is the copy of web.xml
that is in place in the project's WEB-INF
directory. This web.xml
is a copy of one of the templates built at project creation. For example, a copy of the standalone.web.xml
template is built at project creation time and saved as web.xml
. The template that is used depends on your specific project server configuration mappings.
Do not edit the in-place web.xml
directly, but edit a template instead.
web.xml processing at project creation and publishing
Depending on which function you are performing, WebSphere Portlet Factory processes the web.xml
file in different ways.
- When you create a project, a new version of the web.xml file is created from the appropriate template.
- When you upgrade a project, the current web.xml and its template are backed up and a new template is generated.
- When you publish, a new web.xml is created from this template. If you made any changes to your web.xml template, you need to merge them from the template backup into the new template and republish to generate the updated web.xml file.
When publishing the project, or if the user requests a publishing action:
- If this is to be a development WAR publishing request:
- Update web.xml with application context
- Add to Web Archive
- If this is to be a production WAR export request:
- Bundle the specific web.xml in the production WAR.
Other things that impact web.xml
This is a custom ant task that is provided for adding a servlet to web.xml. It just adds a servlet definition and mapping to a named web.xml file.IBM Rational® Application Developer
Occasionally overwrites the web.xml. It does this on the in-place web.xml file only.
Parent topic: Publishing to the IBM WebSphere Application Server JSR 168 and JSR 286 Portlet containers: wpf7
Extending your published application: wpf7