Browse Today's favorites or All time favorites.
Please Sign In or Register to share and submit your questions.
Java Queries
Complete java interview questions library
What is a filter, and how does it work?
A filter dynamically intercepts requests and responses to transform or use the information contained in the requests or responses but typically do not themselves create responses. Filters can also be used to transform the response from the Servlet or JSP before sending it back to client. Filters improve reusability by placing recurring tasks in the filter as a reusable unit.
A good way to think of Servlet filters is as a chain of steps that a request and response must go through before an HTML page in a Web application.
The filters can be used for caching and compressing content, logging and auditing, image conversions (scaling up or down etc), authenticating incoming requests, XSL transformation of XML content, localization of the request and the response, site hit count etc. The filters are configured through the web.xml file as follows:
Make a good first impression during an office interview
- important to be punctual and arrive a few minutes early.
- Confirm directions or drive to the location on the previous day to ensure you know where you are going.
- Put your best foot forward. Dress appropriately for the position you are seeking.
Write a comment