【发布时间】:2017-01-05 13:42:08
【问题描述】:
我试图通过以下链接之一了解异步控制器的实现:
http://shengwangi.blogspot.in/2015/09/asynchronous-spring-mvc-hello-world.html
我对控制器线程收到请求并存在这一点感到困惑。然后服务方法接收到进一步处理的请求。
@RequestMapping("/helloAsync")
public Callable<String> sayHelloAsync() {
logger.info("Entering controller");
Callable<String> asyncTask = new Callable<String>() {
@Override
public String call() throws Exception {
return helloService.doSlowWork();
}
};
logger.info("Leaving controller");
return asyncTask;
}
因为,Controller 存在它并将控制权传递给适当的处理程序映射/jsp。用户会在浏览器上看到什么?
【问题讨论】: