is there any difference between servlet and filter lifecycle?.
+2
A:
No, both a servlet and a filter:
- are instantiated (once) when the context starts
- the
init(..)
method is called - they handle each request - first it passes through all filters and then reaches the servlet
- when the context is destroyed (i.e. when your container stops, or your application is undeployed from the manager console), the
destroy(..)
method is called
Bozho
2010-09-24 10:40:08
A:
I can add that in filters you should invoke next filter in the chain if needed.
Andriy Sholokh
2010-09-24 11:24:04