A filter is an object that filters tasks that are either request to a resource, or response from a resource, or both. Filtering is performed in doFilter method. Filters get configured in deployment descriptor of your application.

BY Best Interview Question ON 19 Jan 2019