## 类的使用
org.springframework.ui.ModelMap

- 使用ModelMap的程序包
  程序包 | 说明
  --- | ---
  org.springframework.ui | Generic support for UI layer concepts.
  org.springframework.validation.support | Support classes for handling validation results.

- - ### org.springframework.ui中ModelMap的使用

    org.springframework.ui中ModelMap的子类
    限定符和类型 | 类和说明
    --- | ---
    `class` | `ExtendedModelMap` Subclass of `ModelMap` that implements the `Model` interface.

    返回ModelMap的org.springframework.ui中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `ModelMap` | ModelMap.`addAllAttributes(Collection<?> attributeValues)` Copy all attributes in the supplied `Collection` into this `Map`, using attribute name generation for each element.
    `ModelMap` | ModelMap.`addAllAttributes(Map<String,?> attributes)` Copy all attributes in the supplied `Map` into this `Map`.
    `ModelMap` | ModelMap.`addAttribute(Object attributeValue)` Add the supplied attribute to this `Map` using a `generated name`.
    `ModelMap` | ModelMap.`addAttribute(String attributeName, Object attributeValue)` Add the supplied attribute under the supplied name.
    `ModelMap` | ModelMap.`mergeAttributes(Map<String,?> attributes)` Copy all attributes in the supplied `Map` into this `Map`, with existing objects of the same name taking precedence (i.e. not getting replaced).

  - ### org.springframework.validation.support中ModelMap的使用

    org.springframework.validation.support中ModelMap的子类
    限定符和类型 | 类和说明
    --- | ---
    `class` | `BindingAwareModelMap` Subclass of `ExtendedModelMap` that automatically removes a `BindingResult` object if the corresponding target attribute gets replaced through regular `Map` operations.