What is the correct order of method calls in the lifecycle of a filter?

  • destroy(), init(), doFilter()
  • doFilter(), init(), destroy()
  • init(), destroy(), doFilter()
  • init(), doFilter(), destroy()
The correct order of method calls in the lifecycle of a filter is init(), doFilter(), destroy(). Filters are initialized first, then the doFilter() method is called for each request, and finally, the destroy() method is called when the filter is removed from service.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *