web.xml中配置——配置springmvc

<servlet>

    <servlet-name>springmvc</servlet-name>   

    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>

    <!-- 指定加载的配置文件 ,通过参数contextConfigLocation加载-->

    <init-param>

        <param-name>contextConfigLocation</param-name>

        <param-value>classpath:applicationContext-web.xml</param-value>

    </init-param>

  </servlet> 

  <servlet-mapping>

    <servlet-name>springmvc</servlet-name>

    <url-pattern>*.do</url-pattern>

  </servlet-mapping>

posted @ 2019-07-02 09:18  keepup~  阅读(663)  评论(0)    收藏  举报