Servlet Filter going in infinite loop when FORWARD used in mapping in JSF

前端 未结 2 996
囚心锁ツ
囚心锁ツ 2021-01-23 18:18

I have a filter defined in web.xml like following:-


    AuthenticationFilter
    

        
2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-23 18:39

    First of all, why do you want to hook on forward/include/error dispatchings as well next to the (default) global and all-covering request?

    Get rid of all those lines in your filter mapping. You don't need any of them for an authentication filter. The HTTP requests are the only which counts. The internal forward/include/error dispatchings can only take place when the HTTP request has already been arrived (and filtered).

    Also, instead of this check on the request URI, you can also map the filter on a more specific like /secured/* or so and put all pages which require a login over there and put the register and login page outside.

提交回复
热议问题