类 ModelAttributeMethodProcessor

  • 所有已实现的接口:
    HandlerMethodArgumentResolver, HandlerMethodReturnValueHandler
    直接已知子类:
    ServletModelAttributeMethodProcessor

    public class ModelAttributeMethodProcessor
    extends Object
    implements HandlerMethodArgumentResolver, HandlerMethodReturnValueHandler
    Resolve @ModelAttribute annotated method arguments and handle return values from @ModelAttribute annotated methods.

    Model attributes are obtained from the model or created with a default constructor (and then added to the model). Once created the attribute is populated via data binding to Servlet request parameters. Validation may be applied if the argument is annotated with @javax.validation.Valid. or Spring's own @org.springframework.validation.annotation.Validated.

    When this handler is created with annotationNotRequired=true any non-simple type argument and return value is regarded as a model attribute with or without the presence of an @ModelAttribute.

    从以下版本开始:
    3.1
    作者:
    Rossen Stoyanchev