views:

31

answers:

1

Hello, I wanna know if there is a function that is called directly after the deployment of the server. This functions could be called as an initialisation function of the deployment. Thanks

+2  A: 

If this is for a single app, you can implement a ServletContextListener, listening on the contextInitialized() event. You can register an implementation through the <listener> tag in your web.xml.

wds
thanks for your answer
ld493
This will happen every time a new instance of your app is started, not just once per deployment.
Nick Johnson
@NickJohnson I didn't think of that. Depending on what he wants to accomplish it's probably still fine though, since I can't see the use case for this on a per-global-deployment basis.
wds