当前位置: 首页>>代码示例>>Java>>正文


Java WebDataBinder.setValidator方法代码示例

本文整理汇总了Java中org.springframework.web.bind.WebDataBinder.setValidator方法的典型用法代码示例。如果您正苦于以下问题:Java WebDataBinder.setValidator方法的具体用法?Java WebDataBinder.setValidator怎么用?Java WebDataBinder.setValidator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.web.bind.WebDataBinder的用法示例。


在下文中一共展示了WebDataBinder.setValidator方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initBinder

import org.springframework.web.bind.WebDataBinder; //导入方法依赖的package包/类
@InitBinder("employeeForm")
public void initBinder(WebDataBinder binder){
	binder.setValidator(employeeValidator);
	
	binder.registerCustomEditor(Date.class, new DateEditor());
	binder.registerCustomEditor(Integer.class, "age", new AgeEditor());
}
 
开发者ID:PacktPublishing,项目名称:Spring-5.0-Cookbook,代码行数:8,代码来源:FormController.java

示例2: initBinder

import org.springframework.web.bind.WebDataBinder; //导入方法依赖的package包/类
@Override
public void initBinder(WebDataBinder binder, WebRequest request) {
	binder.setAutoGrowNestedPaths(this.autoGrowNestedPaths);
	if (this.directFieldAccess) {
		binder.initDirectFieldAccess();
	}
	if (this.messageCodesResolver != null) {
		binder.setMessageCodesResolver(this.messageCodesResolver);
	}
	if (this.bindingErrorProcessor != null) {
		binder.setBindingErrorProcessor(this.bindingErrorProcessor);
	}
	if (this.validator != null && binder.getTarget() != null &&
			this.validator.supports(binder.getTarget().getClass())) {
		binder.setValidator(this.validator);
	}
	if (this.conversionService != null) {
		binder.setConversionService(this.conversionService);
	}
	if (this.propertyEditorRegistrars != null) {
		for (PropertyEditorRegistrar propertyEditorRegistrar : this.propertyEditorRegistrars) {
			propertyEditorRegistrar.registerCustomEditors(binder);
		}
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:26,代码来源:ConfigurableWebBindingInitializer.java

示例3: initBinderFileBucket

import org.springframework.web.bind.WebDataBinder; //导入方法依赖的package包/类
@InitBinder("fileUpload")
protected void initBinderFileBucket(WebDataBinder binder) {
    binder.setValidator(fileValidator);
}
 
开发者ID:Exercon,项目名称:AntiSocial-Platform,代码行数:5,代码来源:FileUploadController.java

示例4: initBinder

import org.springframework.web.bind.WebDataBinder; //导入方法依赖的package包/类
@InitBinder("personForm")
public void initBinder(WebDataBinder binder) {
	binder.setValidator(personalValidator);
	binder.registerCustomEditor(Integer.class, "biography.age",
			new AgeConverter());
	binder.registerCustomEditor(Integer.class, "education.year",
			new YearConverter());
	binder.registerCustomEditor(Date.class, "biography.birthDate",
			new BirthDateConverter());
}
 
开发者ID:PacktPublishing,项目名称:Spring-MVC-Blueprints,代码行数:11,代码来源:PersonalUpdateController.java

示例5: initBinder

import org.springframework.web.bind.WebDataBinder; //导入方法依赖的package包/类
@InitBinder
public void initBinder(WebDataBinder binder) {
	SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
	sdf.setLenient(true);
	binder.registerCustomEditor(Date.class, new CustomDateEditor(sdf, true));
	binder.setValidator(this.validator);
}
 
开发者ID:shilongdai,项目名称:bookManager,代码行数:8,代码来源:ServletApplicationContextConfig.java

示例6: initBinder

import org.springframework.web.bind.WebDataBinder; //导入方法依赖的package包/类
@SuppressWarnings("unused")
@InitBinder
private void initBinder(WebDataBinder binder) {
	binder.initBeanPropertyAccess();
	binder.setRequiredFields("sex");
	LocalValidatorFactoryBean vf = new LocalValidatorFactoryBean();
	vf.afterPropertiesSet();
	binder.setValidator(vf);
	SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
	dateFormat.setLenient(false);
	binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:13,代码来源:ServletAnnotationControllerTests.java

示例7: createBinder

import org.springframework.web.bind.WebDataBinder; //导入方法依赖的package包/类
@Override
public WebDataBinder createBinder(NativeWebRequest webRequest, Object target, String objectName) {
	LocalValidatorFactoryBean validator = new LocalValidatorFactoryBean();
	validator.afterPropertiesSet();
	WebDataBinder dataBinder = new WebDataBinder(target, objectName);
	dataBinder.setValidator(validator);
	return dataBinder;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:9,代码来源:HttpEntityMethodProcessorTests.java

示例8: createBinder

import org.springframework.web.bind.WebDataBinder; //导入方法依赖的package包/类
@Override
public WebDataBinder createBinder(NativeWebRequest webRequest, Object target, String objectName) throws Exception {
	LocalValidatorFactoryBean validator = new LocalValidatorFactoryBean();
	validator.afterPropertiesSet();
	WebDataBinder dataBinder = new WebDataBinder(target, objectName);
	dataBinder.setValidator(validator);
	return dataBinder;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:9,代码来源:RequestResponseBodyMethodProcessorMockTests.java

示例9: initBinderProfileImage

import org.springframework.web.bind.WebDataBinder; //导入方法依赖的package包/类
@InitBinder("profileImageDTO")
protected void initBinderProfileImage(WebDataBinder binder) {
    binder.setValidator(profileImageValidator);
}
 
开发者ID:mintster,项目名称:nixmash-blog,代码行数:5,代码来源:FileUploadController.java

示例10: initBinder

import org.springframework.web.bind.WebDataBinder; //导入方法依赖的package包/类
@InitBinder
private void initBinder(WebDataBinder binder){
    binder.setValidator(validator);
}
 
开发者ID:garyhu1,项目名称:spring_mvc_demo,代码行数:5,代码来源:InputController.java

示例11: initBinder

import org.springframework.web.bind.WebDataBinder; //导入方法依赖的package包/类
@InitBinder
protected void initBinder(WebDataBinder binder) {
	binder.setValidator(userFormValidator);
}
 
开发者ID:filipebraida,项目名称:siga,代码行数:5,代码来源:UserController.java

示例12: initialiseBinder

import org.springframework.web.bind.WebDataBinder; //导入方法依赖的package包/类
@InitBinder("product")
public void initialiseBinder(WebDataBinder binder) {
    binder.setDisallowedFields("unitsInOrder", "discontinued");
    binder.setValidator(productValidator);
}
 
开发者ID:TomirKlos,项目名称:Webstore,代码行数:6,代码来源:ProductController.java

示例13: init

import org.springframework.web.bind.WebDataBinder; //导入方法依赖的package包/类
@InitBinder
public void init(WebDataBinder binder) {
    binder.setValidator(validator);
}
 
开发者ID:GoldRenard,项目名称:JuniperBotJ,代码行数:5,代码来源:ConfigurationController.java

示例14: initBinder

import org.springframework.web.bind.WebDataBinder; //导入方法依赖的package包/类
@InitBinder
private void initBinder(WebDataBinder webDataBinder)
{
	webDataBinder.setValidator(validator);
}
 
开发者ID:PacktPublishing,项目名称:Learning-Spring-5.0,代码行数:6,代码来源:AddBookController.java

示例15: initBinder

import org.springframework.web.bind.WebDataBinder; //导入方法依赖的package包/类
@InitBinder
private void initBinder(WebDataBinder webDataBinder) {
	webDataBinder.setValidator(validator);
}
 
开发者ID:PacktPublishing,项目名称:Learning-Spring-5.0,代码行数:5,代码来源:AddBookController.java


注:本文中的org.springframework.web.bind.WebDataBinder.setValidator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。