SPRING与STRUTS2的整合

SPRING与STURTS2整合有两种方法,一种为<servlet>,一种为<listener>,都是通过ContextLoader加载容器,没有本质的区别,只有SERVLET的区别,即:<listener>会在<servlet>前运行。

---------------------------------------------------------------------------------------------------------------------------------------------------------------------

11.27(Initializing Spring root WebApplicationContext)

在用resin启动spring+struts2时,总是提示Initializing Spring root WebApplicationContext时,不再向下运行。搜索BAIDU后,发现,是数据库不能成功连接上(没有拨vpn)。

---------------------------------------------------------------------------------------------------------------------------------------------------------------------

11.27(加载多个spring配置文件)

有多个配置文件applicationContext.xml  ;  applicationContext_action.xml  ,当在web.xml的<context-param>  <param-name>contextConfigLocation</param-name>赋值classpath:applicationContext*.xml时,失败。改成classpath*:applicationContext*.xml后,成功。

虽然解决了问题,但还是有疑问,毕竟两个文件在一个classpath下(class/*.xml).为什么这么改就成功了?

发布了54 篇原创文章 · 获赞 1 · 访问量 7万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章