web.xml --- Profile Summary

web.xml distributor:

  case1: springMvc dispatcher:

    Action: the request referred springMvc matching processing, the path continues to the processor mapper springMvc

    <servlet>
        <servlet-name>springmvc</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:spring/*-servlet.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>springmvc</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

  case2: Custom servlet dispatcher:

     Action: in the process can be free in their servlet, the web.xml the url defined priority pattern matches, the last matching <url-pattern> / </ url-pattern>

  <servlet>
      <servlet-name>Func1</servlet-name>
      <servlet-class>com.softroad.fun1.action.Func1_Servlet</servlet-class>
  </servlet>
  
  <servlet-mapping>
      <servlet-name>Func1</servlet-name>
      <url-pattern>/Func1/*</url-pattern>
  </servlet-mapping>

web.xml Filters:

  Custom filters: intercepting the request, verify the permissions, file encryption or decryption

  <filter>
      <filter-name>Filter1</filter-name>
      <filter-class>com.softroad.filter.Login_Filter</filter-class>
  </filter>
  
  <filter-mapping>
      <filter-name>Filter1</filter-name>
      <url-pattern>/Func2/*</url-pattern>
  </filter-mapping>

   

 

Reproduced in: https: //www.cnblogs.com/pecool/p/11046559.html

Guess you like

Origin blog.csdn.net/weixin_34281477/article/details/93703921