
2.xmlns:xsi:辅助初始化bean
3.xsi:context:关于spring上下文,包括加载资源文件
4.xsi:schemaLocation:用于声明了目标名称空间的模式文档
可以,你在Struts的配置中这样写就可以了:<plug-in
className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property
property="contextConfigLocation"
value="/WEB-INF/applicationContext1.xml,/WEB-INF/applicationContext2.xml,/WEB-INF/applicationContext3.xml"
/>
</plug-in>
只要用“,”隔开就可以了,可以有多个
这个不是一定的,随你自己的意思,你可以放在WEB-INF里,也可以放在classpath下。只需在配置web.xml时指定位置即可。
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:beans.xml
</param-value>
</context-param>
上面就是web.xml中对spring容器的初始化配置,<context-param>中<param-value>中的classpath:beans.xml 即是spring配置文件beans.xml的位置(classpath下,在myeclipse的工程中是src目录下)
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)