How to map a filter for welcome-file in web.xml for Tomcat?

前端 未结 1 1693
孤城傲影
孤城傲影 2021-01-14 18:27

I have created a Filter to check the Cookies with request object and forward the request accordingly thanks to this and this question.

相关标签:
1条回答
  • 2021-01-14 18:54

    Just add these to your web.xml

    <filter>
      <filter-name>myFilter</filter-name>
      <filter-class>com.examples.myFilter</filter-class>
    </filter>
    
    <filter-mapping>
      <filter-name>myFilter</filter-name>
      <url-pattern>/index.html</url-pattern>
    </filter-mapping>
    
    0 讨论(0)
提交回复
热议问题