java_web的IOC的初始化,是在初始化Tomcat时自动配置
配置spring-web。jar(spring.web包)提供的监听器,此监听器乐意在服务器启动是初始化IOC容器
初始化Ioc容易(applicationcontext.xml)
1、必须告诉监听器此容易的位置:context_param
2、使用默认约定位置,applicationContext.xml必须放在WEB-INF下面且名字必须是这个名字
代码如下
web_1 index.html index.htm index.jsp default.html default.htm default.jsp contextConfigLocation classpath:applicationContext.xml org.springframework.web.context.ContextLoaderListener
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持考高分网。



