May 2015
Intermediate to advanced
234 pages
4h 18m
English
It's convenient to launch a job from a controller method when that job is triggered by a user action. For example, launching a job to process a video just uploaded by the user.
We'll use the job defined in the Creating a job recipe.
Follow these steps to execute the job from a controller method:
getServletConfigClasses()method in your class extending AbstractAnnotationConfigDispatcherServletInitializer:public class ServletInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
@Override
protected Class<?>[] getServletConfigClasses() {
return new Class<?>[]{AppConfig.class, BatchConfig.class};
}Read now
Unlock full access