I did jar application with Spring 3 TaskScheduler. I run this app with main method:
public static void main(String[] args) {
GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
ctx.load("classpath:scheduler-app-context.xml");
ctx.refresh();
while (true) {
// ...
}
// ...
}
Is it please possible run this jar, main method in web application(war file)? How to run this in web.xml.
Many thanks
Do something like this in your
web.xml:This will instantiate your Spring context from the XML file. So it’s not necessary to do this by hand as in your
mainmethod.