The core configuration file for the framework is the default (struts.xml
) file and should reside on the classpath of the webapp (generally /WEB-INF/classes
).
- The default file may include other configuration files as needed.
...
An Example configuration file
Panel |
---|
|
Wiki Markup |
---|
{snippet:id=xworkSample|lang=xml|javadoc=false|url=action2/apps/showcase/src/main/webapp/WEB-INF/classes/xwork-person.xml} |
|
For more about configuration details, see Struts Configuration Elements
The Struts 2 Document Type Definition (DTD)
Panel |
---|
|
Wiki Markup |
---|
{snippet:id=xworkDtd|lang=xml|javadoc=false|url=/xwork/src/java/xwork-1.1.1.dtd} |
|
FAQ
- A
struts-plugin.xml
file can be placed in a JAR and automatically plugged into an application, 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.
FAQ
Can we Can I break up a large struts.xml file into smaller pieces?