我可以为ApplicationContext.xml指定一个不同的名称吗?
正如我在这里看到的答案,我们可以更改applicationcontext文件名,那么spring如何识别它的applicationcontext或beanfactory?
是! 您只需更改web.xml(如果您使用的是Web应用程序).
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/Spring/applicationContext-services.xml
</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
134 次 |
| 最近记录: |