11 January 2021

Servlet Filter

  • A filter is an object that is invoked at the preprocessing and postprocessing of a request.
  • It is mainly used to perform filtering tasks such as conversion, logging, compression, encryption and decryption, input validation etc.
  • FilterChain 
  • FilterConfig - An object of FilterConfig is created by the web container. This object can be used to get the configuration information from the web.xml file.

Usage of Filter

  • recording all incoming requests
  • logs the IP addresses of the computers from which the requests originate
  • conversion
  • data compression
  • encryption and decryption
  • input validation etc.

Advantage of Filter

  • Filter is pluggable.
  • One filter don't have dependency onto another resource.
  • Less Maintenance

No comments:

Post a Comment

Most views on this month