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

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

Introduction

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

Prototype

@Nullable
public Object getView() 

Source Link

Document

Return the View object, or null if we using a view 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 w  w .j  av  a 2  s .  co m*/
    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;
}