Hello,
I am trying to test the latest asynchronous feature of Spring MVC controllers but I have not been able to get it to work.
Here is the code for my async method:
Here is the relevant portion from web.xml:Code:@RequestMapping(value = "/hello") public Callable<String> async(final Model model) { System.out.println("entered async controller method"); return new Callable<String>() { public String call() throws Exception { Thread.sleep(2000L); model.addAttribute("message", "asyncRequest dealt with"); System.out.println("about to return from call()"); return "hello"; } }; }
However "about to return from call()" is never printed in the console and I never get to see such logs as this: 08:25:17 [MvcAsync1] WebAsyncManager - ...Code:<servlet> <servlet-name>SpringMVC</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/spring/webmvc-config.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> <async-supported>true</async-supported> </servlet>
in the console...
FYI, I use Spring 3.2.RC2
Can anyone please help?
Regards,
Julien.


Reply With Quote
