Using Tomcat, @WebFilter doesn't work with inside web.xml

前端 未结 2 1193
醉梦人生
醉梦人生 2020-12-07 01:33

Here\'s a working web.xml:




        
2条回答
  •  一向
    一向 (楼主)
    2020-12-07 02:04

    You must specify a target for the Servlet Filter. Either provide a value for 'servletNames' or 'urlPatterns'.

    http://docs.oracle.com/javaee/6/api/javax/servlet/annotation/WebFilter.html

    e.g.

    @WebFilter(filterName="mustBeSignedInFilter", urlPatterns={ "/signed/in/path/*" })
    public class MustBeSignedInFilter implements Filter
    

提交回复
热议问题