在WEB应用中使用Spring

2020-02-25  本文已影响0人  暮秋moco
<!-- 初始化 spring 容器 -->

<!--启动Web容器时,自动装配 applicationContext.xml 的配置信息并执行它所实现的方法。
如果没有名为 applicationContext.xml 的文件,
需在 context-param 中指定一个Spring容器的初始化配置文件,
本例中是 configSpring.xml -->
<context-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>classpath:configSpring.xml</param-value>
</context-param>
<!-- 启动IOC容器的ContextLoaderListener监听,将IOC容器放入到ServletContext域中 -->
<listener>
      <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
上一篇 下一篇

猜你喜欢

热点阅读