Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Explain Life cycle of Servlet Filter.

Answers were Sorted based on User's Feedback



Explain Life cycle of Servlet Filter...

Answer / sunita

filters life cycle:
The life cycle of a filter is managed by a container. Every
filter must implement the Filter interface. The life cycle
of a filter consists of implementing the following methods:

1. init(): This method is called only once after
instantiation to perform any initialization task.

2. doFilter(): This method is called after the init()
method. It takes three arguments, namely a ServletRequest, a
ServletResponse, and a FilterChain. It is called each time a
filter needs to perform any function. This method performs
the actual work of a filter, either modifying the request or
the response.

3. destroy(): This method is used to perform any cleanup
operation before the container removes a filter instance.

Is This Answer Correct ?    36 Yes 2 No

Explain Life cycle of Servlet Filter...

Answer / 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

More Advanced Java Interview Questions

what is disadvantage of thread?

3 Answers   HCL,


What is servlet preinitialization?

3 Answers   iFlex,


What is an abstract method?

0 Answers  


whats is mean by object and class?

1 Answers   Saka Solutions,


Difference between sleep and suspend?

3 Answers  


what is singleton class? where it mainly used in the projects?

5 Answers   Satyam, Wipro,


Which container method is used to cause a container to be laid out and redisplayed?

0 Answers  


Explain the life cycle of servlet?

3 Answers   Cognizant, HCL,


If I define a method in JSP scriplet <%..%>, where will it go after translation into a servlet?

8 Answers   HeadStrong,


In real time project when will we use Abstract class. and what are the difference between abstract and interface.

6 Answers   DELL, FCS, Polaris, Tanla Solutions, TCS,


Hi I have joined java course. I also want additional help from any tutorials website. Please suggest me tutorials which provides easy to understand online applet tutorials?

0 Answers  


What do you need to set-up a cluster with jboss?

0 Answers  


Categories