类 BindingResultUtils
- java.lang.Object
- org.springframework.validation.BindingResultUtils
public abstract class BindingResultUtils extends Object
Convenience methods for looking up BindingResults in a model Map.- 从以下版本开始:
- 2.0
- 作者:
- Juergen Hoeller
- 另请参阅:
BindingResult.MODEL_KEY_PREFIX
构造器概要
构造器 构造器 说明 BindingResultUtils()
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static BindingResult
getBindingResult(Map<?,?> model, String name)
Find the BindingResult for the given name in the given model.static BindingResult
getRequiredBindingResult(Map<?,?> model, String name)
Find a required BindingResult for the given name in the given model.
构造器详细资料
BindingResultUtils
public BindingResultUtils()
方法详细资料
getBindingResult
public static BindingResult getBindingResult(Map<?,?> model, String name)
Find the BindingResult for the given name in the given model.- 参数:
model
- the model to searchname
- the name of the target object to find a BindingResult for- 返回:
- the BindingResult, or
null
if none found - 抛出:
IllegalStateException
- if the attribute found is not of type BindingResult
getRequiredBindingResult
public static BindingResult getRequiredBindingResult(Map<?,?> model, String name)
Find a required BindingResult for the given name in the given model.- 参数:
model
- the model to searchname
- the name of the target object to find a BindingResult for- 返回:
- the BindingResult (never
null
) - 抛出:
IllegalStateException
- if no BindingResult found