Start page / Plug-In Development / Implementation and Deployment / Module Architecture / Web Application Settings
Web Application Settings
The file web.xml contains mandatory information about the web application component of the FirstSpirit Module. Additionally, it may contain parameters that will be used during run-time by individual plug-ins provided by the module.
For a module carrying only ContentCreator plug-ins, this file follows a rather basic format; most blocks defined by the XML schema are optional in this case. When the JAR file carrying this web.xml is rolled into ContentCreator's archive, only the <context-param> blocks are retained. Otherwise, the module's web.xml file is present only to adhere to Java servlet standards.
Example: web.xml
In the ContentCreator Example module framework, the file web.xml is stored in the directory src/web immediately under the module's root directory. If you wish to move this file, you must also modify the Ant build configuration so that it can be located while assembling the FSM file. |
Note that this example specifies neither a servlet nor a servlet mapping. The classes provided in the module's JAR file will be rolled into the project-specific ContentCreator application as this application is started or updated via ServerManager; thus, any servlet specifications made here would be impractical. |
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/j2ee"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<display-name>FirstSpirit WebEdit Examples</display-name>
<description>WebApp to provide all classes.</description>
<context-param>
<param-name>webedit.action.workflow</param-name>
<param-value>$WORKFLOW</param-value>
</context-param>
</web-app>
This file offers a very simple description of the web application component that will be added to the ContentCreator web application during roll-out (as described in the chapter Deploying Modules: Adding Client Plug-Ins to a ContentCreator 5 Web Application).
This code provides a display name (<display-name>) and a short description (<description>) of the web application code.
Additionally, the <context-param> block specifies a parameter tuple consisting of a name (<param-name>) and a value (<param-value>), which can be accessed through the servlet context within this module's Java classes during run-time. In this example, the single <context-param> block defines a parameter named webedit.action.workflow with a value $WORKFLOW - this parameter is used in the ContentCreator Examples module's StartWorkflowWebeditInlineEditItemsPlugin.
Mandatory XML Blocks
Block | Mandatory | Location | Description |
---|---|---|---|
<web-app></web-app> | yes | top-level | The top-level container. Defines the version of the deployment descriptor as well as the DTD or XML schema that defines the descriptor format. |
Optional XML Blocks
Block | Mandatory | Location | Description |
---|---|---|---|
<display-name></display-name> | within <web-app> | A terse display name that identifies this web application. | |
<description></description> | within <web-app> | A short description of this web application's purpose and functionality. | |
<context-param></context-param> | within <web-app> | A parameter that will be available to classes of this web application by accessing the servlet context during its run-time. Requires a name/value tuple (see <param-name> and <param-value> below. | |
<param-name></param-name> | once in each <context-param> block | within <context-param> | Defines the name of the parameter. |
<param-value></param-value> | once in each <context-param> block | within <context-param> | Specifies the parameter's value. |