gpt4 book ai didi

org.springframework.web.bind.support.WebExchangeDataBinder.getBindingResult()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-21 15:05:05 25 4
gpt4 key购买 nike

本文整理了Java中org.springframework.web.bind.support.WebExchangeDataBinder.getBindingResult()方法的一些代码示例,展示了WebExchangeDataBinder.getBindingResult()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebExchangeDataBinder.getBindingResult()方法的具体详情如下:
包路径:org.springframework.web.bind.support.WebExchangeDataBinder
类名称:WebExchangeDataBinder
方法名:getBindingResult

WebExchangeDataBinder.getBindingResult介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-framework

private void updateBindingContext(BindingContext context, ServerWebExchange exchange) {
  Map<String, Object> model = context.getModel().asMap();
  model.keySet().stream()
      .filter(name -> isBindingCandidate(name, model.get(name)))
      .filter(name -> !model.containsKey(BindingResult.MODEL_KEY_PREFIX + name))
      .forEach(name -> {
        WebExchangeDataBinder binder = context.createDataBinder(exchange, model.get(name), name);
        model.put(BindingResult.MODEL_KEY_PREFIX + name, binder.getBindingResult());
      });
}

代码示例来源:origin: spring-projects/spring-framework

private void validate(Object target, Object[] validationHints, MethodParameter param,
    BindingContext binding, ServerWebExchange exchange) {
  String name = Conventions.getVariableNameForParameter(param);
  WebExchangeDataBinder binder = binding.createDataBinder(exchange, target, name);
  binder.validate(validationHints);
  if (binder.getBindingResult().hasErrors()) {
    throw new WebExchangeBindException(param, binder.getBindingResult());
  }
}

代码示例来源:origin: spring-projects/spring-framework

.doOnSuccess(aVoid -> {
  validateIfApplicable(binder, parameter);
  BindingResult errors = binder.getBindingResult();
  model.put(BindingResult.MODEL_KEY_PREFIX + name, errors);
  model.put(name, value);
})
.then(Mono.fromCallable(() -> {
  BindingResult errors = binder.getBindingResult();
  if (adapter != null) {
    return adapter.fromPublisher(errors.hasErrors() ?

代码示例来源:origin: org.springframework/spring-web-reactive

private void addBindingResult(HandlerResult result, ServerWebExchange exchange) {
  BindingContext context = result.getBindingContext();
  Map<String, Object> model = context.getModel().asMap();
  model.keySet().stream()
      .filter(name -> isBindingCandidate(name, model.get(name)))
      .filter(name -> !model.containsKey(BindingResult.MODEL_KEY_PREFIX + name))
      .forEach(name -> {
        WebExchangeDataBinder binder = context.createDataBinder(exchange, model.get(name), name);
        model.put(BindingResult.MODEL_KEY_PREFIX + name, binder.getBindingResult());
      });
}

代码示例来源:origin: org.springframework/spring-web-reactive

protected void validate(Object target, Object[] validationHints,
    MethodParameter param, BindingContext binding, ServerWebExchange exchange) {
  String name = Conventions.getVariableNameForParameter(param);
  WebExchangeDataBinder binder = binding.createDataBinder(exchange, target, name);
  binder.validate(validationHints);
  if (binder.getBindingResult().hasErrors()) {
    throw new WebExchangeBindException(param, binder.getBindingResult());
  }
}

代码示例来源:origin: org.springframework/spring-web-reactive

.doOnSuccess(aVoid -> {
  validateIfApplicable(binder, parameter);
  BindingResult errors = binder.getBindingResult();
  model.put(BindingResult.MODEL_KEY_PREFIX + name, errors);
  model.put(name, value);
})
.then(Mono.fromCallable(() -> {
  BindingResult errors = binder.getBindingResult();
  if (adapter != null) {
    return adapter.fromPublisher(errors.hasErrors() ?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com