Example usage for org.springframework.web.method.support ModelAndViewContainer isViewReference

List of usage examples for org.springframework.web.method.support ModelAndViewContainer isViewReference

Introduction

In this page you can find the example usage for org.springframework.web.method.support ModelAndViewContainer isViewReference.

Prototype

public boolean isViewReference() 

Source Link

Document

Whether the view is a view reference specified via a name to be resolved by the DispatcherServlet via a ViewResolver.

Usage

From source file:co.paralleluniverse.springframework.web.servlet.mvc.method.annotation.FiberRequestMappingHandlerAdapter.java

private ModelAndView getModelAndView(ModelAndViewContainer mavContainer, ModelFactory modelFactory,
        NativeWebRequest webRequest) throws Exception {
    modelFactory.updateModel(webRequest, mavContainer);
    if (mavContainer.isRequestHandled()) {
        return null;
    }/* w  ww .  j  a v  a  2  s . c om*/
    ModelMap model = mavContainer.getModel();
    ModelAndView mav = new ModelAndView(mavContainer.getViewName(), model);
    if (!mavContainer.isViewReference()) {
        mav.setView((View) mavContainer.getView());
    }
    if (model instanceof RedirectAttributes) {
        Map<String, ?> flashAttributes = ((RedirectAttributes) model).getFlashAttributes();
        HttpServletRequest request = webRequest.getNativeRequest(HttpServletRequest.class);
        RequestContextUtils.getOutputFlashMap(request).putAll(flashAttributes);
    }
    return mav;
}