接口的使用
org.springframework.ui.Model
使用Model的程序包 程序包 说明 org.springframework.ui Generic support for UI layer concepts.org.springframework.validation.support Support classes for handling validation results.org.springframework.web.reactive Top-level package for thespring-webflux
module that containsDispatcherHandler
, the main entry point for WebFlux server endpoint processing including key contracts used to map requests to handlers, invoke them, and process the result.org.springframework.web.reactive.result.method.annotation Infrastructure for annotation-based handler method processing.org.springframework.web.servlet.mvc.support Support package for MVC controllers.org.springframework.ui中Model的使用
实现Model的org.springframework.ui中的类 修饰符和类型 类 说明 class
ConcurrentModel
Implementation of theModel
interface based on aConcurrentHashMap
for use in concurrent scenarios.class
ExtendedModelMap
返回Model的org.springframework.ui中的方法 修饰符和类型 方法 说明 Model
Model. addAllAttributes(Collection<?> attributeValues)
Copy all attributes in the suppliedCollection
into thisMap
, using attribute name generation for each element.Model
Model. addAllAttributes(Map<String,?> attributes)
Copy all attributes in the suppliedMap
into thisMap
.Model
Model. addAttribute(Object attributeValue)
Add the supplied attribute to thisMap
using agenerated name
.Model
Model. addAttribute(String attributeName, Object attributeValue)
Add the supplied attribute under the supplied name.Model
Model. mergeAttributes(Map<String,?> attributes)
Copy all attributes in the suppliedMap
into thisMap
, with existing objects of the same name taking precedence (i.e. not getting replaced).org.springframework.validation.support中Model的使用
实现Model的org.springframework.validation.support中的类 修饰符和类型 类 说明 class
BindingAwareConcurrentModel
Subclass ofConcurrentModel
that automatically removes theBindingResult
object when its corresponding target attribute is replaced through regularMap
operations.class
BindingAwareModelMap
Subclass ofExtendedModelMap
that automatically removes aBindingResult
object if the corresponding target attribute gets replaced through regularMap
operations.org.springframework.web.reactive中Model的使用
org.springframework.web.reactive.result.method.annotation中Model的使用
参数类型为Model的org.springframework.web.reactive.result.method.annotation中的方法 修饰符和类型 方法 说明 protected void
AbstractNamedValueArgumentResolver. handleResolvedValue(Object arg, String name, MethodParameter parameter, Model model, ServerWebExchange exchange)
Invoked after a value is resolved.protected void
PathVariableMethodArgumentResolver. handleResolvedValue(Object arg, String name, MethodParameter parameter, Model model, ServerWebExchange exchange)
org.springframework.web.servlet.mvc.support中Model的使用
org.springframework.web.servlet.mvc.support中Model的子接口 修饰符和类型 接口 说明 interface
RedirectAttributes
A specialization of theModel
interface that controllers can use to select attributes for a redirect scenario.实现Model的org.springframework.web.servlet.mvc.support中的类 修饰符和类型 类 说明 class
RedirectAttributesModelMap