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

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

Introduction

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

Prototype

public SessionStatus getSessionStatus() 

Source Link

Document

Return the SessionStatus instance to use that can be used to signal that session processing is complete.

Usage

From source file:org.springframework.web.method.annotation.ModelFactory.java

/**
 * Promote model attributes listed as {@code @SessionAttributes} to the session.
 * Add {@link BindingResult} attributes where necessary.
 * @param request the current request//ww  w  .j  av  a 2s.  c  o  m
 * @param container contains the model to update
 * @throws Exception if creating BindingResult attributes fails
 */
public void updateModel(NativeWebRequest request, ModelAndViewContainer container) throws Exception {
    ModelMap defaultModel = container.getDefaultModel();
    if (container.getSessionStatus().isComplete()) {
        this.sessionAttributesHandler.cleanupAttributes(request);
    } else {
        this.sessionAttributesHandler.storeAttributes(request, defaultModel);
    }
    if (!container.isRequestHandled() && container.getModel() == defaultModel) {
        updateBindingResult(request, defaultModel);
    }
}