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

The following examples show how to use org.springframework.web.bind.WebDataBinder#initBeanPropertyAccess() . 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: UriTemplateServletAnnotationControllerHandlerMethodTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@InitBinder
public void initBinder(WebDataBinder binder, @PathVariable("hotel") String hotel) {
	assertEquals("Invalid path variable value", "42", hotel);
	binder.initBeanPropertyAccess();
	SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
	dateFormat.setLenient(false);
	binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
}
 
Example 2
Source File: ServletAnnotationControllerHandlerMethodTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@InitBinder
public 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));
}
 
Example 3
Source File: ServletAnnotationControllerHandlerMethodTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@InitBinder
public void initBinder(WebDataBinder binder) {
	binder.initBeanPropertyAccess();
	SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
	dateFormat.setLenient(false);
	binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
}
 
Example 4
Source File: UriTemplateServletAnnotationControllerHandlerMethodTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@InitBinder
public void initBinder(WebDataBinder binder, @PathVariable("hotel") String hotel) {
	assertEquals("Invalid path variable value", "42", hotel);
	binder.initBeanPropertyAccess();
	SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
	dateFormat.setLenient(false);
	binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
}
 
Example 5
Source File: ServletAnnotationControllerHandlerMethodTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@InitBinder
public 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));
}
 
Example 6
Source File: ServletAnnotationControllerHandlerMethodTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@InitBinder
public void initBinder(WebDataBinder binder) {
	binder.initBeanPropertyAccess();
	SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
	dateFormat.setLenient(false);
	binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
}
 
Example 7
Source File: UriTemplateServletAnnotationControllerTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@InitBinder
public void initBinder(WebDataBinder binder, @PathVariable("hotel") String hotel) {
	assertEquals("Invalid path variable value", "42", hotel);
	binder.initBeanPropertyAccess();
	SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
	dateFormat.setLenient(false);
	binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
}
 
Example 8
Source File: ServletAnnotationControllerTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@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));
}
 
Example 9
Source File: ServletAnnotationControllerTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@InitBinder
public void initBinder(WebDataBinder binder) {
	binder.initBeanPropertyAccess();
	SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
	dateFormat.setLenient(false);
	binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
}
 
Example 10
Source File: UriTemplateServletAnnotationControllerHandlerMethodTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@InitBinder
public void initBinder(WebDataBinder binder, @PathVariable("hotel") String hotel) {
	assertEquals("Invalid path variable value", "42", hotel);
	binder.initBeanPropertyAccess();
	SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
	dateFormat.setLenient(false);
	binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
}
 
Example 11
Source File: ServletAnnotationControllerHandlerMethodTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@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));
}
 
Example 12
Source File: ServletAnnotationControllerHandlerMethodTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@InitBinder
public void initBinder(WebDataBinder binder) {
	binder.initBeanPropertyAccess();
	SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
	dateFormat.setLenient(false);
	binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
}
 
Example 13
Source File: ServletAnnotationControllerHandlerMethodTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@InitBinder
public void initBinder(WebDataBinder binder) {
	binder.initBeanPropertyAccess();
	binder.registerCustomEditor(Map.class, new CustomMapEditor());
}
 
Example 14
Source File: ServletAnnotationControllerHandlerMethodTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@InitBinder
public void initBinder(WebDataBinder binder) {
	binder.initBeanPropertyAccess();
	binder.registerCustomEditor(Map.class, new CustomMapEditor());
}
 
Example 15
Source File: ServletAnnotationControllerTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@InitBinder
public void initBinder(WebDataBinder binder) {
	binder.initBeanPropertyAccess();
	binder.registerCustomEditor(Map.class, new CustomMapEditor());
}
 
Example 16
Source File: ServletAnnotationControllerHandlerMethodTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@InitBinder
public void initBinder(WebDataBinder binder) {
	binder.initBeanPropertyAccess();
	binder.registerCustomEditor(Map.class, new CustomMapEditor());
}