web 请求的处理

来源:互联网 发布:怎么开淘宝网店货源 编辑:程序博客网 时间:2024/05/16 13:57

1、不论向web应用发起请求来源于页面,还是服务器!都是有web.xml中的配置进行处理!

2、web.xml中

  <servlet>
    <description>spring mvc servlet</description>
    <servlet-name>springMvc</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
      <description>spring mvc 配置文件</description>
      <param-name>contextConfigLocation</param-name>
      <param-value>classpath:spring-mvc.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>

配置servlet基本信息

3、

  <servlet>
    <servlet-name>TFEPServlet</servlet-name>   //1
    <servlet-class>com.wetaxiwa.FEPServlet</servlet-class> //2
  </servlet>

 <servlet-mapping>
    <servlet-name>TFEPServlet</servlet-name> //3
    <url-pattern>/fep/taobao</url-pattern>  //4
  </servlet-mapping>

3和1保持一致,请求来源于4,根据3找到1,使用2中类处理相关请求

0 0
原创粉丝点击