How to call a Java method while deploying a WAR
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s not clear what you mean by “deploy”. Is that the moment when the WAR file arrives on the app server? Maybe you gin something up with Ant. Is that when the app starts up? Maybe you can do it with a ServletContextListener.
There’s no mechanism for doing so built into any Java EE app server I know of, so you’re out of luck if Ant isn’t suitable. You need something that does the deploying to do it for you.
What’s your purpose for doing so? What does this method do?