Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Two key configuration files From a Struts developer point of view, the one required configuration file utilized by the framework are is web.xml and struts.xml. The configuration elements in these two files will reference any other required or optional configuration files. From here, you have full control over how Struts configures both itself and your application. By default, Struts will load a set of internal configuration files to configure itself, then another set to configure your application, however it is possible to build an entire Struts application without writing a single configuration file other than web.xml.

The table lists the files that you can use to configure the framework for your application. Some configuration files can be reloaded dynamically. Dynamic reloading makes interactive development possible. See Reloading configuration for more.

File

Optional

Location (relative to webapp)

Purpose

web.xml

no

/WEB-INF/

Web deployment descriptor to include all necessary framework components

struts.xml

no

/WEB-INF/classes/

Main configuration, contains result/view types, action mappings, interceptors, and so forth

struts.properties

yes

/WEB-INF/classes/

Framework properties

struts-default.xml

yes

/WEB-INF/lib/struts2-core.jar

Default configuration that should be included in struts.xml provided by Struts

struts-default.vm

yes

/WEB-INF/classes/

Default macros referenced by velocity.properties

struts-plugin.xml

yes

At the root of a plugin JAR

Optional configuration files for Plugins in the same format as struts.xml.

velocity.properties

yes

/WEB-INF/classes/

Override the default Velocity configuration

...