A filter is implemented to log request details. Where should this logging take place in the filter's methods?
- destroy()
- doFilter()
- filterConfig()
- init()
The logging of request details in a filter should take place within the doFilter() method, which is called for each request and allows processing of the request and response.
Loading...
Related Quiz
- What is a common practice to reduce the load on a servlet?
- In a scenario where a filter chain is used for both compression and encryption, which process should ideally occur first?
- For an e-commerce application that needs to track user session activity and attribute changes, what combination of listeners would be ideal?
- Which method should be overridden to make a servlet thread-safe without synchronizing the entire service method?
- How are requests forwarded from servlets to the appropriate view in an MVC framework?