in a J2EE application when does a listener get called?
I have a J2EE app and it has a listener in web.xml
.
Listener contains a method called contextInitialized
I want to know when does contextInitialized
actually get called?
From my reading I understand that it gets called when deploying the application. Can there be situations/scenario's where it could be called after the application has been deployed? Say that I am in a Clustered GlassFish app server environment. Could it be called a开发者_开发百科fter the application has been deployed?
It's called once when the application is first deployed. It shouldn't get called again if the application stays deployed.
However, the application may go through the undeploy/deploy cycle while the server is running. For example, you can set it up so that the application is redeployed when a file is changed in the directory.
精彩评论