What is Servlet Filter And What does it work?



What is Servlet Filter And What does it work?..

Answer / surajkumar.java

Filters are powerful tools of Servlet platform. These are
just like a servlet which plugs into the request handling
process and executes in addition to the normal page
processing. Filters manipulate both request and response in
web application. Filters can be applied to any resources
like HTML, graphics, a JSP page, servlet etc, served by a
servlet engine. These are commonly used for authentication,
data format conversion and page redirect to other page and
catching etc.
A java class which implements javax.servlet.Filter is
configured as filter in web.xml file. For each request in
web application, the servlet container decides which filters
to apply, and adds those filters to a chain in the same
order they appear in web.xml. As a filter is just like a
servlet, it has its life cycle (init(), doFilter() and
destroy() methods).

Is This Answer Correct ?    22 Yes 3 No

Post New Answer

More Advanced Java Interview Questions

what is the life cycle of jsp?

1 Answers   HCL, ITC Infotech,


How can a dead thread be restarted?

1 Answers   IBM, Wipro,


What is a session? Can you share a session object between different theads?

0 Answers  


When is the best time to validate input?

0 Answers  


Which are the different segments of memory?

0 Answers  






what is JTS?

1 Answers  


What is prototype?

0 Answers  


how can we load a file of a user in the database table?

3 Answers   ITC Infotech,


life cycle of an applet?

3 Answers  


what is meant by JRMP?

0 Answers  


Explain the advantages and disadvantages of detached objects.

0 Answers  


What is the relationship between local interfaces and container-managed relationships?

0 Answers  


Categories