I wonder if you could help me with this:

At first sorry if I am asking something easy, but I am amateur in this.

I have a tomcat server in my computer and I have several services (programmed in java language with Eclipse) in it. What I would like to know is if it is possible to stablish a code that should be execute in each service when Tomcat server turns on or reset. If it is possible, how could I do that?

有帮助吗?

解决方案

A ServletContextListener is meant for exactly this type of thing. Your implementation of contextInitialized() will be called when the server starts the "context" (meaning the webapp).

其他提示

You can create a Context Creation listener.(ServletContextListener)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top