1、struts.xml:常用此方法配置
例如:
<constant name="struts.devMode" value="true"></constant> 配置配置开发者模式
2、struts.properties
例如:
struts.devMode=true
3、web.xml:可通过<filter>的<init-param>子元素指定
例如:
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilte</filter-class>
<init-param>
<param-name>struts.devMode</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
struts2 按照如下顺序加载struts2的常量:
struts-defualt.xml,struts-piugin.xml,struts.xml,struts.properties,web.xml
一些可用的配置,请参见:http://lisanlai.iteye.com/blog/1314662