+ -
当前位置:首页 → 问答吧 → Struts2读取配置文件时属性值是否会覆盖

Struts2读取配置文件时属性值是否会覆盖

时间:2011-08-19

来源:互联网

我知道是struts2读取配置文件的顺序是:

struts-default.xml、

struts-plugin.xml、

struts.xml、

struts.properties、

web.xml

如果在 struts-plugin.xml中定义了

<constant name="struts.objectFactory.spring.autoWire" value="type" />

但是在sturts.xml中定义了

<constant name="struts.objectFactory.spring.autoWire" value="name" />

那么最后自动注入属性时是按什么注入的,如果后面配置文件会把先读取的文件的属性值给覆盖掉,为什么会覆盖掉呢?最好给解释下原因,或者给个相关连接也行,谢谢!!!

作者: ldhscxl   发布时间: 2011-08-19

顶,怎么没人回复,

作者: ldhscxl   发布时间: 2011-08-19

1 struts.properties先 读取
2 然后struts-default.xml
3 再struts.xml

1中没有,就用2的,
1中没有,就用2的,3有就覆盖
1中有,3也有就覆盖


作者: softroad   发布时间: 2011-08-19

这,这,这,这,还真没研究过。

作者: FarAwayHome   发布时间: 2011-08-19

热门下载

更多