
WAR的appContext.xml和WAR的Webxml都是可行的。如果需要同时基于localSpringContext.xml和外部jar的applicationContext.xml运行集成测试,则建议使用WAR的appContext.xml方法。
更新1:
WAR的appContext.xml:
<import resource="classpath:{classpath}/applicationContext.xml"/>WAR的Web xml:
<context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath:localSpringContext.xml classpath:{classpath}/applicationContext.xml</param-value></context-param>例如,如果您的applicationContext.xml在软件包:com / gmail / hippoom下
您可以通过带通配符的classpath:com / gmail / hippoom / applicationContext.xml或classpath
*:applicationContext.xml来获取。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)