Hi,
I am using
Tomcat 4.0.As you know,listener and filter are the new features of
Servlet Specification 2.3 and Tomcat 4.0 support
these new features.I added D:\jakarta-tomcat-4.0-b7\common\lib\servlet.jar to CLASSPATH in my system,but I still
can not compile the following program.It produced "cannot resolve symbol class ServletContextEvent,ServletContextListener,...... "
Please help me.
--------------------------
<!--MyContextListener.java-->
package com.listeners;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextAttributeEvent;
import javax.servlet.ServletContextAttributesListener;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
public final class MyContextListener
implements ServletContextListener {
private ServletContext context = null;
public MyContextListener() {}
//This method is invoked when the Web Application
//has been removed and is no longer able to accept
//requests
public void contextDestroyed(ServletContextEvent event)
{
//Output a simple message to the server's console
System.out.println("The Simple Web App. Has Been Removed");
this.context = null;
}
//This method is invoked when the Web Application
//is ready to service requests
public void contextInitialized(ServletContextEvent event)
{
this.context = event.getServletContext();
//Output a simple message to the server's console
System.out.println("The Simple Web App. Is Ready");
}
}