Is it possible to add another filter in addition to Katharsis filter

100 views Asked by At

I'm using Katharsis in my spring boot application in order to support json-api.

I setup Katharsis using Resources as described here: https://www.baeldung.com/json-api-java-spring-web-app

Now, I want to add another custom filter to my spring boot app. I tried adding this filter:

@Component
public class SchemaFilter implements Filter {

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        HttpServletRequest request = (HttpServletRequest) servletRequest;
        String application = request.getHeader("application");
        System.out.println(application);
    }

}

But it is not working.

Any ideas?

1

There are 1 answers

0
Adi Ohana On BEST ANSWER

I forgot to add @Order annotation to my filter:

@Order(Ordered.HIGHEST_PRECEDENCE)