The core configuration file for the framework is the default (struts.xml
) file.
- The default file may include other configuration files as needed.
- An additional
struts.xml
files can be placed in any package on the classpath, so that modules can be self-contained and automatically configured. - In the case of Freemarker and Velocity modules, the templates can also be loaded from the classpath, so the entire module can be plugged in as a single JAR.
- See Struts Configuration Elements for a description of the various elements.
An Example configuration file
Panel |
---|
|
Wiki Markup |
---|
{snippet:id=xworkSample|lang=xml|javadoc=false|url=struts2/apps/showcase/src/main/webapp/WEB-INF/classes/xworkresources/struts-person.xml} |
|
For more about configuration details, see Struts Configuration Elements
The Struts 2 Document Type Definition (DTD)
Panel |
---|
title | struts-Struts 2.0 .dtdDTD |
---|
|
Wiki Markup |
---|
{snippet:id=xworkDtdstrutsDtd|lang=xml|javadoc=false|url=xwork2struts2/core/src/main/javaresources/xworkstruts-12.20.dtd} |
|
FAQ
Can we break up a large struts.xml file into smaller pieces?