When filter destroy method is called?
Beside this, what is doFilter called?
For each request, the method doFilter is called once. The statements in doFilter are executed until "chain.doFilter(req, resp)" is reached. " chain.doFilter(req, resp)" causes the execution to be continued in the next filter in chain or in the servlet.
Correspondingly, when servlet filter is called?
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. The servlet filter is pluggable, i.e. its entry is defined in the web.
The doFilter method of the Filter is called by the container each time a request/response pair is passed through the chain due to a client request for a resource at the end of the chain. The FilterChain passed in to this method allows the Filter to pass on the request and response to the next entity in the chain.