Niu, I suggest that you go to the Listener tutorial site posted on this site. Copy or write the code for the classes and web.xml. Even if you copy the code, you will have to put the classes and the additions to the deployment descriptor in the correct places and this is good practice. Understand what the output is to the screen with the System.println (output to the Tomcat 4.0 window) from the program. These examples give you an excellent way to understand listeners and when they are accessed.