I read as below about servlet filter
To prepare the filter for service server calls init(FilterConfig) once, then calls doFilter().
The FilterConfig interface has methods for retrieving the filte name,init parameters, active servlet context.
The server calls destroy() to indicate that the filter is no longer in service.
Then filter can calls chain.doFilter() to shift control to the next filter.
I wonder why init called once. And how init call prepares a filter. To me filter lifecycle looks similar to servlet. How they are different
i thought doFilter is to intercept request and response but i wonder how doFilter() shifts control to other filter.
I do not see the name of other filter name in above line. How it doescall other filter.
Any links resources ideas highly appreciated. Thanks in advance