开发者

in a J2EE application when does a listener get called?

开发者 https://www.devze.com 2022-12-28 21:29 出处:网络
I have a J2EE app and it has a listener in web.xml. Listener contains a method called contextInitialized

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号