弹簧容器如何启动以及如何装载弹簧容器

时间:2013-08-18 11:50:49

标签: java spring

我想知道弹簧容器实际上是如何在服务器上加载的......以及有多少种方法可以完成 以及服务器如何知道它必须启动弹簧容器。 我试着去谷歌,但没有运气。

1 个答案:

答案 0 :(得分:1)

最简单的解决方案是使用ContextLoaderListener

<listener>
  <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<context-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>/WEB-INF/applicationContext*.xml</param-value>
</context-param>

有关详细信息,请参阅http://static.springsource.org/spring/docs/4.0.x/spring-framework-reference/html/web-integration.html