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.
Loading...
Related Quiz
- For file download, what Content-Type should be set in the servlet response?
- To prevent XSS attacks, it is essential to _________ user input and _________ user output.
- The __________ listener is useful for monitoring changes in request attributes during the lifespan of a request.
- What is a session ID in the context of web applications?
- The __________ method is used to set an HTTP status code without a message.