Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
新しいWARファイルをデプロイするたびに、コードの一部を実行するか、Tomcatの起動時に、それぞれのサーブレットがコードを継続的に起動または実行するように使用できるメソッドまたはAPIはありますか。
「ContextListener」を web.xml に含めることができます。このクラスのインスタンスは、Web アプリケーション WAR がデプロイまたは開始されるときに作成されます。
このコードは、アプリがデプロイされるまで実行し続けるスレッドを開始できます。
例: http://www.javafaq.nu/java-example-code-233.html