Tomcat 新手,在 Eclipse 环境中运行 Tomcat 7。
我关注了a tutorial用于创建 ServletContextListener
类。我的问题很简单,我如何在 Tomcat 中加载和运行它?我可以使用注释吗?我需要编辑 xml 文件吗?
最佳答案
Javadoc救援:
In order to receive these notification events, the implementation class must be either declared in the deployment descriptor of the web application, annotated with WebListener, or registered via one of the addListener methods defined on ServletContext.
关于java - 在 Tomcat 7 中加载我的 ServletContextListener,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10538867/