加载spring配置
在tomcat中使用spring十分简单,首先下载spring相关的依赖包放到lib目录下,然后在web.xml文件增加
如下内容,表示加载spring框架
<context-param>
<param-name> contextConfigLocation</param-name>
<param-value> /WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
在tomcat中使用spring十分简单,首先下载spring相关的依赖包放到lib目录下,然后在web.xml文件增加
如下内容,表示加载spring框架
<context-param>
<param-name> contextConfigLocation</param-name>
<param-value> /WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>