What is Servlet Filter And What does it work?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the design considerations while making a choice between using interface and abstract class?

541


difference between  ejb,struts,hibernate,spring and jsp

2299


What are the call back methods in entity bean?

557


What is an abstract method?

590


Difference between new operator and class.forname().newinstance()?

598






What are externizable interface?

580


Whats new with the stop(), suspend() and resume() methods in jdk 1.2?

581


what are RemoteObjects?

2254


Explain the different types of memory used by jvm?

608


What is prototype?

606


Explain what is orm?

672


cud u help me ... i am struggling with this question... to find all the subsets of a given set for ex.... a,,b,c shud give all the subsets.... i gt the program in c bt nt able to get it in java..... help needed ..

1732


What is the infobus?

610


What is Stream Tokenizer?

1726


How messaging services are done, before release of JMS?

1583