本文整理汇总了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());
}
示例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);
}
}
}
示例3: initBinderFileBucket
import org.springframework.web.bind.WebDataBinder; //导入方法依赖的package包/类
@InitBinder("fileUpload")
protected void initBinderFileBucket(WebDataBinder binder) {
binder.setValidator(fileValidator);
}
示例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());
}
示例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);
}
示例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));
}
示例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;
}
示例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);
}
示例10: initBinder
import org.springframework.web.bind.WebDataBinder; //导入方法依赖的package包/类
@InitBinder
private void initBinder(WebDataBinder binder){
binder.setValidator(validator);
}
示例11: initBinder
import org.springframework.web.bind.WebDataBinder; //导入方法依赖的package包/类
@InitBinder
protected void initBinder(WebDataBinder binder) {
binder.setValidator(userFormValidator);
}
示例12: initialiseBinder
import org.springframework.web.bind.WebDataBinder; //导入方法依赖的package包/类
@InitBinder("product")
public void initialiseBinder(WebDataBinder binder) {
binder.setDisallowedFields("unitsInOrder", "discontinued");
binder.setValidator(productValidator);
}
示例13: init
import org.springframework.web.bind.WebDataBinder; //导入方法依赖的package包/类
@InitBinder
public void init(WebDataBinder binder) {
binder.setValidator(validator);
}
示例14: initBinder
import org.springframework.web.bind.WebDataBinder; //导入方法依赖的package包/类
@InitBinder
private void initBinder(WebDataBinder webDataBinder)
{
webDataBinder.setValidator(validator);
}
示例15: initBinder
import org.springframework.web.bind.WebDataBinder; //导入方法依赖的package包/类
@InitBinder
private void initBinder(WebDataBinder webDataBinder) {
webDataBinder.setValidator(validator);
}