Are you sure that your filer is invoked at all? Do you see any outputs in logs from your filter? (BTW I would suggest using logger instead of System.out.println). I think that you are missing the annotation @Order and may be your filter is not in use. ALso, since you only want to apply your filter for the path "/flight/*" there is a better way to register your filter using a FilterRegistrationBean. See a good article on the subject here: How to Define a Spring Boot Filter?