首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

Struts配置文件的优先级——恒量配置

2012-09-01 
Struts配置文件的优先级——常量配置struts的常量配置可以在struts.xml、web.xml、struts.properties都可以。例

Struts配置文件的优先级——常量配置

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。

热点排行