Multiple choice technology web technology

An 'Intercepting filter' design pattern can be implemented to ______

  1. to preprocess requests

  2. to post process responses

  3. to preprocess responses

  4. to preprocess and post process requests and responses

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The Intercepting Filter pattern can handle both request preprocessing and response postprocessing. Filters intercept incoming requests before they reach the servlet (for tasks like authentication or logging) and can also modify outgoing responses after servlet processing (for tasks like compression or adding headers). This bidirectional capability makes it flexible for handling cross-cutting concerns.