ServletContextListener (Java EE 5)

Java EE API


javax.servlet Interface ServletContextListener

All Superinterfaces:
EventListener

public interface ServletContextListener
extends EventListener

Implements: java.util.EventListener

此接口的实现接收有关其所属 Web 应用程序的 servlet 上下文更改的通知。要接收通知事件,必须在 Web 应用程序的部署描述符中配置实现类。
英文文档:

Implementations of this interface receive notifications about changes to the servlet context of the web application they are part of. To receive notification events, the implementation class must be configured in the deployment descriptor for the web application.

Since:
v 2.3
See Also:
ServletContextEvent

Method Summary
 void
 void
 

Method Detail

public void contextInitialized(ServletContextEvent sce)
通知将开始 Web 应用程序初始化过程。在初始化 Web 应用程序中的所有过滤器或 servlet 之前,应该通知所有 ServletContextListener 关于上下文初始化的信息。
英文文档:

contextInitialized

void contextInitialized(ServletContextEvent sce)
Notification that the web application initialization process is starting. All ServletContextListeners are notified of context initialization before any filter or servlet in the web application is initialized.


public void contextDestroyed(ServletContextEvent sce)
通知即将关闭 servlet 上下文。在通知所有 ServletContextListener 上下文销毁之前,所有 servlet 和过滤器都已销毁。
英文文档:

contextDestroyed

void contextDestroyed(ServletContextEvent sce)
Notification that the servlet context is about to be shut down. All servlets and filters have been destroy()ed before any ServletContextListeners are notified of context destruction.



Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!