经过实验,测试结果如下:
启动顺序:MyListener ->MyFilter ->MyServlet
- MyListener.contextInitialized
- MyFilter.init
- 2012-05-23 17:15:09.869:INFO::Started SelectChannelConnector@0.0.0.0:8080
- [INFO] Started Jetty Server
- MyServlet.init
- MyServlet.service
- MyServlet.service
- MyServlet.service
- MyFilter.destroy
- MyServlet.destroy
- MyListener.contextDestroyed
销毁顺序:MyFilter ->MyServlet -> MyListener
本文转自 tianya23 51CTO博客,原文链接:http://blog.51cto.com/tianya23/874776,如需转载请自行联系原作者