Adi Ohana
Adi Ohana

Reputation: 947

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

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?

Upvotes: 0

Views: 117

Answers (1)

Adi Ohana
Adi Ohana

Reputation: 947

I forgot to add @Order annotation to my filter:

@Order(Ordered.HIGHEST_PRECEDENCE)

Upvotes: 0

Related Questions