求ServletContextEvent详解?

求是科技 发布于 2016/09/08 10:12
阅读 507
收藏 0

我从这里开始跟进代码,

<listener>
		<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
	</listener>
一直跟到

public class ServletContextEvent extends java.util.EventObject { 

    private static final long serialVersionUID = -7501701636134222423L;

    /** Construct a ServletContextEvent from the given context.
     *
     * @param source - the ServletContext that is sending the event.
     */
    public ServletContextEvent(ServletContext source) {
        super(source);
    }
    
    /**
     * Return the ServletContext that changed.
     *
     * @return the ServletContext that sent the event.
     */
    public ServletContext getServletContext () { 
        return (ServletContext) super.getSource();
    }



还是没明白 监听器的原理,谢谢大神指导?


    



加载中
返回顶部
顶部