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 the call back methods in entity bean?

573


What restrictions are placed on the location of a package statement within a source code file?

627


How to deploy Jar, War files in J2EE?

2184


what is handle?

1867


What is a modular application?

604






What is the relation between the infobus and rmi?

568


Name three component subclasses that support painting?

624


Why are component architectures useful?

583


What is a clone?

580


what is a non-repeatable read?

1836


AS a developer will u create a data source in connection pool? If so how will u do that, how to access the object from connection pool using IRAD tool?

1654


how to make a index.jsp for running the site in internet and find an error for connection with weblogic server and java that give an error invalid object name.and how to maintain session.

1769


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

584


What’s jboss cache in short?

615


What you mean by COM and DCOM?

627