Loading my ServletContextListener in Tomcat 7
java, tomcat7
Solution
Javadoc to the rescue:
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.
Problem
New to Tomcat and running Tomcat 7 in an Eclipse environment. I followed a tutorial for creating a `ServletContextListener` class. My question is, simply, how do I get this loaded and running in Tomcat? Can I use annotations? Do I need to edit an xml file?