struts的常量配置可以在struts.xml、web.xml、struts.properties都可以。
例如在配置编码时:
1.struts.xml:
<constant name=""struts.i18n.encoding" value="GBK"></constant>
2.struts.properties:
struts.i18n.encoding = GBK
3.web.xml
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>GBK</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
他们的优先级是:web.xml > struts.properties > struts.xml。
Struts框架常量配置
2461

被折叠的 条评论
为什么被折叠?



