The question always arises: how can I make sure something happens as soon as I load a web module; or how can I initialize something as soon as an HttpSession is created. The solution is to use a lifcyle listner, such as an HttpSessionListener or a WebContextListener.

Here's a tutorial on how to create a web context listener, and an HttpSesionListener: