OncePerRequestFilter
Learn OncePerRequestFilter (Filters, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Fresher Notes OncePerRequestFilter is a Spring base class that guarantees doFilterInternal runs only one time per request, even with forwards or error dispatches. You override doFilterInternal(request, response, filterChain) and call filterChain.doFilter yourself to continue. Why use it : a plain Filter can run twice when a request is forwarded internally; this class marks the request with an attribute to skip repeats.