How to set up filter chain in spring boot?

后端 未结 2 810
感情败类
感情败类 2021-02-13 22:03

I have come across spring-boot and intend to add a filter chain for incoming request.

Here is the Application:

package example.hello;

import org.springf         


        
相关标签:
2条回答
  • 2021-02-13 22:34

    I would just like to clarify a little more on what Gangadhar suggested. You can try adding :

    filterChain.doFilter(servletRequest, servletResponse);

    in doFilter method of your filter classes.This will create chaining of the filters.

    0 讨论(0)
  • 2021-02-13 22:37

    Adding following line of code in GreetingFilter works

    filterChain.doFilter(servletRequest, servletResponse);
    
    0 讨论(0)
提交回复
热议问题