SPR-8593 Fix issue in ModelAndViewMethodReturnValueHandler with ModelAndView containing a View

This commit is contained in:
Rossen Stoyanchev
2011-09-14 16:26:02 +00:00
parent 38f05678c1
commit 1300da06a6
3 changed files with 124 additions and 24 deletions

View File

@@ -42,8 +42,10 @@ public class ModelAndViewMethodReturnValueHandler implements HandlerMethodReturn
NativeWebRequest webRequest) throws Exception {
if (returnValue != null) {
ModelAndView mav = (ModelAndView) returnValue;
mavContainer.setView(mav.getView());
mavContainer.setViewName(mav.getViewName());
if (!mav.isReference()) {
mavContainer.setView(mav.getView());
}
mavContainer.addAllAttributes(mav.getModel());
}
else {