Explain Life cycle of Servlet Filter.

Answer Posted / surajkumar.java

A java class which implements javax.servlet.Filter is
configured as filter in web.xml file.
The web container calls the init method to initialize filter
by passing javax.servlet.FilterConfig object to retrieve the
filter’s init parameters.
The doFilter method of Filter class performs the actual
processing like authentication, data format conversion and
page redirect to other page and catching etc. The doFilter
method passes the request and response object of the current
request and the filter chain object to invoke next filter in
the chain.
Web container calls the destroy() method to take the filter
out of service.

Is This Answer Correct ?    29 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What class is the top of the awt event hierarchy?

688


Define the remote object implementation?

2074


Explain ioc concept?

729


Why are my checkboxes not being set from on to off?

747


What is table mutation and how do you avoid it?

2005






Which javutil classes and interfaces support event handling?

673


What is difference between object state and behavior?

677


What’s jboss cache in short?

705


What is the difference between the ‘font’ and ‘fontmetrics’ class?

728


what are getters and setters in Java with examples?

1369


Name three component subclasses that support painting?

696


What modifiers may be used with an interface declaration?

667


how i secure my site with the https protocol.what are the steps?

1824


What is a policy?

1882


what is meant by JRMP?

1901