将web.xml文件修改为:
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<!-- 指定spring mvc 配置文件的路径 默认为 /WEB-INF/<[servlet-name]-servlet.xml> 例如此处为/WEB-INF/spring-servlet.xml
下面配置的也就是默认值 -->
<param-value>classpath:spring-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>*.shtml</url-pattern>
</servlet-mapping>