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).爲什麼這麼改就成功了?