2 Minutes To Code (β Version)

Java Servlets - 2 minute tutorial

Introduction to http request filters

Filters intercept the http requests coming to the http server.

The container passes the http request and http response object to the filter. The filter (which contains user defined logic) can process the request and response as required and then pass them to other filters in the chain or to the servlet.

After the servlet has processed the request and generated the response, all the filters are again invoked in the reverse order before the response is sent back to the http clinet.