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

Explain the steps in details to load the server object dynamically?

0 Answers  


Explain lazy activation?

1 Answers   HCL,


what are design patterns in java?give with example?

2 Answers   HCL, iGate,


what is Static binding?

2 Answers   Wipro,


On a computer that having single CPU, how multithreading concept can be achieved?

1 Answers   Zensar,


whats is mean by connectionpooling

0 Answers   SolutionNET,


For an example, if we have some variable in run method, and we created one or more threads. Does all threads will share the same variable or a copy of variable is created for each thread??

1 Answers  


What is preemptive and Non-preemptive Time Scheduling?

6 Answers   Cognizant,


diff between jsp include directive and jsp action include?

4 Answers   SolutionNET,


How to determine applet?s height and width?

1 Answers  


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

0 Answers  


What event results from the clicking of a button?

0 Answers  


Categories