Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Description

To make it easy to manage large scale development (lots of actions + configuration), WebWork allows you to include other configuration files from xwork.xml :A popular strategy is "divide and conquer". The framework lets you apply "divide and conquer" to configuration files using the <include .../> element.

Code Block
xml
xml

<xwork>
<!DOCTYPE struts PUBLIC
  "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
  "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
    <include file="webwork-defaultHome.xml"/>
    <include file="userHello.xml"/>
    <include file="shoppingcartSimple.xml"/>
    <include file="product/util/POJO.xml"/>
    <include ....file="/com/initech/admin/admin-struts.xml"/>
</xwork>struts>

The Each included files file must be in the same format as xworkstruts.xml (with the doctype and everything) and be placed on classpath (usually in /WEB-INF/classes or jar files in /WEB-INF/lib)., including the DOCTYPE. The include files can be placed anywhere on the classpath and should be referred to by that path by the "file" attribute.

In a large-team environment, the include files can be used to organize different modules of the application that are being developed by different team members. Most of the content here provided by Matt Dowell <matt.dowell@notiva.com>