1.项目的目录结构图:
2.web.xml
1 <?xml version="1.0" encoding="UTF-8"?> 2 <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
5 http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> 6 7 8 <!-- spring监听器,监听springMvc环境 --> 9 <listener>10 <listener-class>org.springframework.web.context.ContextLoaderListener
</listener-class>11 </listener>12 <!-- 加载spring的配置文件 -->13 <context-param>14 <param-name>contextConfigLocation
</param-name>15 <param-value>/WEB-INF/springmvc-servlet.xml
</param-value>16 </context-param>17 <!-- 配置Spring MVC DispatcherServlet -->18 <servlet>19 <servlet-name>springmvc
</servlet-name>20 <servlet-class>org.springframework.web.servlet.DispatcherServlet
</servlet-class>21 <load-on-startup>2
</load-on-startup>22 </servlet>23 <servlet-mapping>24 <servlet-name>springmvc
</servlet-name>25 <url-pattern>*.do
</url-pattern>26 </servlet-mapping>27 </web-app>
3
posted @
2014-03-15 10:36 若愚若怯 阅读(462) |
评论 (0) |
编辑 收藏
1.下图说明Spring MVC中请求被处理的过程:
posted @
2014-03-13 21:02 若愚若怯 阅读(161) |
评论 (0) |
编辑 收藏