码迷,mamicode.com
首页 > Web开发 > 详细

web.xml中servlet, bean, filter, listenr 加载顺序汇总

时间:2014-09-23 21:27:55      阅读:221      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   使用   ar   sp   on   c   

最终得出结果:先 listener >> filter >> servlet >> spring

所以,如果过滤器中要使用到 bean,可以将spring 的加载 改成 Listener的方式

<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>

 

参考文档:http://konglx.iteye.com/blog/1838094 

web.xml中servlet, bean, filter, listenr 加载顺序汇总

标签:style   blog   http   color   使用   ar   sp   on   c   

原文地址:http://www.cnblogs.com/brucetie/p/3989055.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!