通过SpringMVC的周期 我们知道了Spring的dispatcherSerlvet是springMVC的前端控制器 所以 我们必然需要在Spring中配置一些它的信息
首先 我们如果想使用Spring mvc 则我们需要添加Spring的一些JAR包 需要的JAR包就不做累述。
首先 我们需要在web.xml中使 我们的程序支持Spring mvc 添加如下的配置信息
<!-- 设置spring容器加载配置文件路径 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext-common.xml</param-value>
</context-param>
<!-- 添加spring监听器 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- 配置Spring核心控制器 -->
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:d