Versions Compared

Key

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

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 additional A struts-plugin.xml files file can be placed in any package on the classpatha 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.
  • See Struts Configuration Elements for a description of the various elements.

An Example configuration file

...

    • .

...

...

{snippet:id=xworkSample|lang=xml|javadoc=false|url=struts2/apps/showcase/src/main/resources/struts-person.xml}

(lightbulb) For more about configuration details, see Struts Configuration Elements

The Struts 2 Document Type Definition (DTD)

Panel
titleStruts 2.0 DTD
Wiki Markup
{snippet:id=strutsDtd|lang=xml|javadoc=false|url=struts2/core/src/main/resources/struts-2.0.dtd}

FAQ

Can we break up a large struts.xml file into smaller pieces?

Next: struts.xml Examples