Skip to main content

Filter Chain

Learn Filter Chain (Filters, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Fresher Notes FilterChain is the object passed to doFilter that represents the remaining filters and finally the servlet. Calling chain.doFilter(req, res) hands control to the next element; code before the call runs on the way in, code after it runs on the way out. Like layers of an onion : the first filter wraps all the others and sees the response last.

More lessons in Filters