PrepZone Logo
PrepZone
Back to Spring Boot

Spring Boot · Hard

Difference between OncePerRequestFilter and GenericFilterBean.

Spring BootSpring SecurityFilter ChainStaffArchitect

Answer preview

Recommendation: Always extend OncePerRequestFilter for custom filters in Spring Security. The "once per request" guarantee prevents duplicate JWT validation or logging on the same request.…