sub*_*ubh 5 java spring spring-mvc
在web-app中,我们为spring定义上下文配置位置以初始化所有这样的bean
<!-- Spring Application Configuration -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/ctx-*.xml</param-value>
</context-param>
<listener>
<description>Spring Context Listener</description>
<display-name>SpringContextListener</display-name>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
Run Code Online (Sandbox Code Playgroud)
我试图找出,如果有可能在jar文件(包含所有的spring bean)中做到这一点,我没有web.xml?
您可以使用前缀“类路径:”
classpath:ctx-*.xml
Run Code Online (Sandbox Code Playgroud)
请参阅http://static.springsource.org/spring/docs/2.5.6/reference/resources.html#resources-app-ctx
| 归档时间: |
|
| 查看次数: |
6447 次 |
| 最近记录: |