码迷,mamicode.com
首页 > 编程语言 > 详细

springMVC 学习(一)

时间:2016-08-11 00:36:53      阅读:162      评论:0      收藏:0      [点我收藏+]

标签:

web.xml中配置dispatcherServlet类

<!-- 监听Spring容器配置 -->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
   <!-- 业务层和持久层的spring配置文件,这些配置文件为父spring容器所应用 -->
  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath*:applicationContext.xml</param-value>
  </context-param> 
  <!-- 监听Spring容器配置 --> 
  <servlet>
    <servlet-name>spring</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>/WEB-INF/spring-mvc.xml</param-value>
    </init-param>
  </servlet>
  <servlet-mapping>
    <servlet-name>spring</servlet-name>
    <url-pattern>*.html</url-pattern>  请求过滤后缀
  </servlet-mapping>

 

springMVC 学习(一)

标签:

原文地址:http://www.cnblogs.com/peng111/p/5759279.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!