A popular strategy is "divide and conquer". The framework lets you apply "divide and conquer" to configuration files using the include <include .../>
element.
Code Block | ||||
---|---|---|---|---|
| ||||
<!DOCTYPE xworkstruts PUBLIC "-//OpenSymphonyApache Software GroupFoundation//XWork 1.1.1DTD Struts Configuration 2.0//EN" "http://wwwstruts.opensymphonyapache.comorg/xworkdtds/xworkstruts-12.1.10.dtd"> <xwork><struts> <include file="struts-defaultHome.xml"/> <include file="Home-configHello.xml"/> <include file="Hello-configSimple.xml"/> <include file="Simple-config/util/POJO.xml"/> <include file="Pojo-config/com/initech/admin/admin-struts.xml"/> </xwork>struts> |
Each included file must be in the same format as struts.xml
, including the doctype
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.