The only way I know of which I used in the past is to implement a ServletContextListener packaged in your WAR, you can put custom code in the contextInitialized method which will be called when your application gets deployed.
S.D.
[Message sent by forum member 'samdoyle' (samdoyle)]
http://forums.java.net/jive/thread.jspa?messageID=237327