In what scenario would a filter be used instead of a servlet?

  • For authentication and logging
  • For handling HTTP requests
  • For managing session state
  • For processing business logic
Filters are typically used for tasks such as authentication, logging, and modifying the request and response. In scenarios where the primary purpose is not to generate a response, but to perform pre or post-processing, filters are preferred over servlets.
Add your answer
Loading...

Leave a comment

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