Example usage for org.springframework.web.bind ServletRequestDataBinder closeNoCatch

List of usage examples for org.springframework.web.bind ServletRequestDataBinder closeNoCatch

Introduction

In this page you can find the example usage for org.springframework.web.bind ServletRequestDataBinder closeNoCatch.

Prototype

public void closeNoCatch() throws ServletRequestBindingException 

Source Link

Document

Treats errors as fatal.

Usage

From source file:org.springframework.web.servlet.mvc.multiaction.MultiActionController.java

/**
 * Bind request parameters onto the given command bean
 * @param request request from which parameters will be bound
 * @param command command object, that must be a JavaBean
 * @throws Exception in case of invalid state or arguments
 *///from   ww w.j a v  a2s .com
protected void bind(HttpServletRequest request, Object command) throws Exception {
    logger.debug("Binding request parameters onto MultiActionController command");
    ServletRequestDataBinder binder = createBinder(request, command);
    binder.bind(request);
    if (this.validators != null) {
        for (Validator validator : this.validators) {
            if (validator.supports(command.getClass())) {
                ValidationUtils.invokeValidator(validator, command, binder.getBindingResult());
            }
        }
    }
    binder.closeNoCatch();
}