【发布时间】:2013-03-13 09:50:57
【问题描述】:
我正在使用 Spring MVC 异步处理,但控制器没有在 Web 浏览器上返回视图。
@RequestMapping(value = "/generateGM", method = RequestMethod.POST)
public Callable<ModelAndView> generateGMReport(@RequestParam("countryCode") int countryCode, ModelAndView mv) {
Callable<ModelAndView> c = new GenericCallable(countryCode, reportDao, mv);
return c;
}
@Override
public ModelAndView call() throws Exception {
List<CostReport> gmList = reportDao.generateGrossMarginReport(countryCode);
mv.setViewName("gmReport");
mv.addObject("gmList", gmList);
return mv;
}
我曾尝试修改代码以返回 Callable,但它仍然没有返回到指定的视图名称。
我正在使用 JBoss 7.1。
部署时出现警告:
WARN [org.jboss.as.ee] (MSC service thread 1-7)
JBAS011006: Not installing optional component
org.springframework.web.context.request.async.StandardServletAsyncWebRequest
due to exception: org.jboss.as.server.deployment.DeploymentUnitProcessingException:
JBAS011054:
Could not find default constructor for class
org.springframework.web.context.request.async.StandardServletAsyncWebRequest
原因:sitemesh 可能无法从 Spring MVC 框架(AsynContext)设置响应对象。
是什么原因?
请帮忙。
谢谢。
【问题讨论】:
-
请提供任何指导。如果需要更多信息,请告诉我。
-
我试图禁用 sitemesh 过滤器,它返回了一些结果,但是启用了 sitemesh 过滤器后没有返回 html。此外,还有 WARN [org.jboss.as.ee] (MSC service thread 1-7) JBAS011006: Not installed optional component org.springframework.web.context.request.async.StandardServletAsyncWebRequest due to exception: org.jboss.as .server.deployment.DeploymentUnitProcessingException: JBAS011054: 找不到类 org.springframework.web.context.request.async.StandardServletAsyncWebRequest 的默认构造函数
标签: spring servlets spring-mvc asynchronous