我想知道 spring 容器实际上是如何加载到服务器上的..以及可以通过多少种方式来完成 以及服务器如何知道它必须启动 spring 容器。 我尝试用谷歌搜索,但没有成功。
最佳答案
最简单的解决方案是使用 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>
关于java - spring容器如何启动以及加载spring容器的方式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18298746/