ChinaUnix.net
相关文章推荐:

javalangNoClassDefFoundError ServletContextListener

This J2EE tip demonstrates use of servletcontextlistener. This event class handles notifications about changes to the servlet context of the Web application that they are part of. This can be explained as if someone is present on the server and dynamically informing us about the events that are occuring on the server. There acquire need of Listners. Therefore, ServletContextListner is helpf...

by liugao_0614 - Java文档中心 - 2007-10-29 10:57:00 阅读(620) 回复(0)

相关讨论

应用场景示例: 在部署描述文件(web.xml)中设置一个上下文参数和监听者类,监听者根据这个参数构造一个对象,并将这个对象放入上下文属性当中,这样在整个WEB应用的任何地方,都可以使用此类 例: ①--------修改部署描述文件 在web.xml的web-app节点下创建: 数据库类型 dbType mysql 在web.xml的web-app节点下创建: cu.blog.liuxingyuyuni.module.Dbservletcontextlistener ②-...

by liuxingyuyuni - Java文档中心 - 2008-04-06 13:46:17 阅读(993) 回复(0)

JSP/Servlet 中的事件处理写过AWT或Swing程序的人一定对桌面程序的事件处理机制印象深刻:通过实现Listener接口的类可以在特定事件(Event)发生时,呼叫特定的方法来对事件进行响应。 其实我们在编写JSP/Servle程序时,也有类似的事件处理机制,所不同的是在JSP/Servlet中是在web.xml中注册Listener,由Container在特定事件发生时呼叫特定的实现Listener的类。 1. Servlet中的Listener和Event: 在JSP 2.0/Servlet 2.4中,共有八...

by softiger - Java文档中心 - 2006-10-12 21:58:33 阅读(1008) 回复(0)

我用jsvc的脚本关闭Tomcat,就是kill $PID,但是servletcontextlistener无法得到contextDestroyed消息。如果使用Tomcat的shutdown.sh脚本关闭Tomcat,servletcontextlistener就可以得到contextDestroyed消息。 是不是jsvc的kill方法关闭服务不是合适的(gracefull)?但是,用jsvc启动,shutdown.sh就无法关闭。 请问大家如何解决?或者给我一些资料。谢谢。

by ideawu - Java - 2006-07-11 12:12:48 阅读(1777) 回复(0)

怎么用 ? 请以tomcat服务器为例。谢谢 是不是实现这个接口的类还需要在服务器中进行配置什么的?

by zhangv - Java - 2003-05-09 11:33:49 阅读(2598) 回复(4)