Filters are used for pre processing of requests and post processing of response before reaching target resources

Filter
The common uses of filters are:

  1. Security Checks
  2. Altering request information
  3. Altering response information
  4. Logging request information
  5. Compression of response
  6. Encryption of response

Filters concepts has introduced in Servlet2.3 version.