This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
according to The Java Servlet specification version 2.3 "A filter dynamically intercepts requests and responses to transform or use the information contained in the requests or responses. Filters typically do not themselves create responses, but instead provide universal functions that can be "attached" to any type of servlet or JSP page. .."
Filter is basically used to filter the request and responce. It is a certain API defined by the Filter, FilterChain, and FilterConfig interfaces in the javax.servlet package. With the help of this unwanted data refined by the filter and only required data only goes to server.