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 are memory considerations of jsp compares to other web components?

6254


What are the different class loaders used by jvm?

807


What is the form of storage space in java?

1953


How messaging services are done, before release of JMS?

1803


What happens when a thread cannot acquire a lock on an object?

746


How can I scroll through list of pages like the search results in google?

766


Can I map more than one table in a cmp?

788


Explain about local interfaces.

794


Define the remote object implementation?

2183


When a thread blocks on i/o, what state does it enter?

796


Can I run seam outside of jboss as?

812


What is threadfactory?

846


What is the difference between the session.get() method and the session.load() method?

808


What is abstract schema?

750


What is an abstract method?

782