當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。