搭建spring框架
1、在web,xml中配置Spring的监听器(项目启动加载Spring的配置文件,因为Spring是SpringMVC的父容器)
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/spring-application-context.xml</param-value>
</context-param>
2、在spring-application-context.xml配置扫描组件
<context:component-scan base-package="com.lvleigang.frame">
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
</context:component-scan>