Portlet Factory, Version 6.1.2


 

web.xml processing and templates

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 at deployment time to facilitate new deployments.

 

web.xml template files

The following web.xml template files are used in IBM® WebSphere Portlet Factory.

geronimo-web.xml

Used in conjunction with wasce.web.xml on WebSphere Application Server Community Edition servers

portlet.standard.web.xml

Used for Java™ Standard Portlets

portlet.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 deployment targets (standalone and portal) from a single project. These files are included in the deployment archive during the deployment 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 deployment targets (local and remote) from a single project. These files are included in the deployment archive during the deployment process.

 

The WEB-INF\web.xml file

The WEB-INF\web.xml file is the copy of web.xml that is in place in the project 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 deployment configuration mappings.

Do not edit the in-place web.xml directly, but edit a template instead.

 

web.xml processing at project creation and deployment

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.

  • During deployment, 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 redeploy to generate the updated web.xml file.

When deploying the project, or if the user requests a deployment action:

  • If this is to be a development WAR deployment request:

    • Update web.xml with application context

    • Add to Web Archive

  • If this is to be a production WAR deployment request:

    • Bundle the specific web.xml in the production WAR.

 

Other things that impact web.xml

addaservlet utility

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.

  • Extending a deployment

    You can write ant scripts to extend a project's functionality or perform deployment operations that you would otherwise have to do manually.

  • Pre-compiling model JSPs

    Pre-generating and pre-compiling Java Server Pages (JSPs) prior to deployment eliminates the delay a user experiences due to the lag time caused by waiting for JSP pages to generate and compile.

  • Implementing Pre and Post Deployment actions

    Put scripts that you want to execute before deployment or redeployment in the project's WEB-INF/bin/predeploy directory.

Parent topic: Overview: deployment


Library | Support |