Java Code Examples for org.springframework.web.bind.WebDataBinder#addValidators()

The following examples show how to use org.springframework.web.bind.WebDataBinder#addValidators() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StaffController.java    From SA47 with The Unlicense 5 votes vote down vote up
@InitBinder("course")
private void initCourseBinder(WebDataBinder binder) {
	SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
	dateFormat.setLenient(false);
	binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
	binder.addValidators(cValidator);

}
 
Example 2
Source File: ValidatorAdvice.java    From springlets with Apache License 2.0 5 votes vote down vote up
/**
 * Adds the {@link CollectionValidator} to the supplied {@link WebDataBinder}
 * 
 * @param binder web data binder.
 */
@InitBinder
public void initBinder(WebDataBinder binder) {
  Object target = binder.getTarget();
  if (target != null && collectionValidator.supports(target.getClass())) {
    binder.addValidators(collectionValidator);
  }
}
 
Example 3
Source File: CodeHtmlController.java    From spring-boot-doma2-sample with Apache License 2.0 4 votes vote down vote up
@InitBinder("codeForm")
public void validatorBinder(WebDataBinder binder) {
    binder.addValidators(codeFormValidator);
}
 
Example 4
Source File: RegistrationController.java    From pizzeria with MIT License 4 votes vote down vote up
@InitBinder
public void initBinder(WebDataBinder webDataBinder) {
    webDataBinder.addValidators(customerRegistrationFormValidator);
}
 
Example 5
Source File: ReviewController.java    From pizzeria with MIT License 4 votes vote down vote up
@InitBinder("reviewForm")
public void initBinder(WebDataBinder webDataBinder) {
    webDataBinder.addValidators(reviewFormValidator);
    webDataBinder.setBindEmptyMultipartFiles(false);
}
 
Example 6
Source File: ResetPasswordHtmlController.java    From spring-boot-doma2-sample with Apache License 2.0 4 votes vote down vote up
@InitBinder("changePasswordForm")
public void validatorBinder(WebDataBinder binder) {
    binder.addValidators(changePasswordFormValidator);
}
 
Example 7
Source File: OrderController.java    From pizzeria with MIT License 4 votes vote down vote up
@InitBinder
public void initBinder(WebDataBinder webDataBinder) {
    webDataBinder.addValidators(pizzaBuilderFormValidator);
}
 
Example 8
Source File: PizzaBuilderController.java    From pizzeria with MIT License 4 votes vote down vote up
@InitBinder("pizzaBuilderForm")
public void initBinder(WebDataBinder webDataBinder) {
    webDataBinder.addValidators(pizzaBuilderFormValidator);
}
 
Example 9
Source File: SettingsController.java    From retro-game with GNU Affero General Public License v3.0 4 votes vote down vote up
@InitBinder
public void initBinder(WebDataBinder binder) {
  binder.addValidators(settingsFormValidator);
}
 
Example 10
Source File: AdminUserController.java    From SA47 with The Unlicense 4 votes vote down vote up
@InitBinder("user")
private void initUserBinder(WebDataBinder binder) {
	binder.addValidators(uValidator);
}
 
Example 11
Source File: MailTemplateHtmlController.java    From spring-boot-doma2-sample with Apache License 2.0 4 votes vote down vote up
@InitBinder("mailTemplateForm")
public void validatorBinder(WebDataBinder binder) {
    binder.addValidators(mailTemplateFormValidator);
}
 
Example 12
Source File: UserHtmlController.java    From spring-boot-doma2-sample with Apache License 2.0 4 votes vote down vote up
@InitBinder("userForm")
public void validatorBinder(WebDataBinder binder) {
    binder.addValidators(userFormValidator);
}
 
Example 13
Source File: StaffHtmlController.java    From spring-boot-doma2-sample with Apache License 2.0 4 votes vote down vote up
@InitBinder("staffForm")
public void validatorBinder(WebDataBinder binder) {
    binder.addValidators(staffFormValidator);
}
 
Example 14
Source File: CodeCategoryHtmlController.java    From spring-boot-doma2-sample with Apache License 2.0 4 votes vote down vote up
@InitBinder("codeCategoryForm")
public void validatorBinder(WebDataBinder binder) {
    binder.addValidators(codeCategoryFormValidator);
}
 
Example 15
Source File: ProfileController.java    From webauthn4j-spring-security with Apache License 2.0 4 votes vote down vote up
@InitBinder("profileCreateForm")
public void initProfileCreateFormBinder(WebDataBinder binder) {
    binder.addValidators(profileCreateFormValidator);
}
 
Example 16
Source File: ControllerAdviceTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@InitBinder
public void initDataBinder(WebDataBinder dataBinder) {
	if (this.validator != null) {
		dataBinder.addValidators(this.validator);
	}
}
 
Example 17
Source File: ApiConsumerResourceController.java    From entando-core with GNU Lesser General Public License v3.0 4 votes vote down vote up
@InitBinder
protected void initBinder(WebDataBinder binder) {
    binder.addValidators(validator);
}
 
Example 18
Source File: UserController.java    From spring-boot with Apache License 2.0 4 votes vote down vote up
@InitBinder("form") //spring mvc 验证
public void initBinder(WebDataBinder binder) {
    binder.addValidators(userCreateFormValidator);
}
 
Example 19
Source File: ModelInitializerTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@InitBinder
public void initDataBinder(WebDataBinder dataBinder) {
	if (this.validator != null) {
		dataBinder.addValidators(this.validator);
	}
}
 
Example 20
Source File: GlobalExceptionHandler.java    From example-restful-project with MIT License 2 votes vote down vote up
/**
 * Adds {@link TeapotValidator} to WebDataBinder.
 *
 * @param binder    WebDataBinder
 */
@InitBinder
public void dataBinding(WebDataBinder binder) {
    binder.addValidators(teapotValidator);
}