本文整理了Java中org.springframework.web.bind.support.WebExchangeBindException.<init>()
方法的一些代码示例,展示了WebExchangeBindException.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebExchangeBindException.<init>()
方法的具体详情如下:
包路径:org.springframework.web.bind.support.WebExchangeBindException
类名称:WebExchangeBindException
方法名:<init>
暂无
代码示例来源: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
if (adapter != null) {
return adapter.fromPublisher(errors.hasErrors() ?
Mono.error(new WebExchangeBindException(parameter, errors)) :
valueMono);
throw new WebExchangeBindException(parameter, errors);
代码示例来源: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
if (adapter != null) {
return adapter.fromPublisher(errors.hasErrors() ?
Mono.error(new WebExchangeBindException(parameter, errors)) :
Mono.just(value));
throw new WebExchangeBindException(parameter, errors);
代码示例来源:origin: spring-cloud/spring-cloud-open-service-broker
@Test
public void webExchangeBindExceptionException() throws NoSuchMethodException {
BindingResult bindingResult = new MapBindingResult(new HashMap<>(), "objectName");
bindingResult.addError(new FieldError("objectName", "field1", "message"));
bindingResult.addError(new FieldError("objectName", "field2", "message"));
Method method = this.getClass().getMethod("setUp", (Class<?>[]) null);
MethodParameter parameter = new MethodParameter(method, -1);
WebExchangeBindException exception =
new WebExchangeBindException(parameter, bindingResult);
ErrorMessage errorMessage = exceptionHandler.handleException(exception);
assertThat(errorMessage.getError()).isNull();
assertThat(errorMessage.getMessage()).contains("field1");
assertThat(errorMessage.getMessage()).contains("field2");
}
内容来源于网络,如有侵权,请联系作者删除!