Spring Framework ConfigurableWebBindingInitializer - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework ConfigurableWebBindingInitializer class.

This code example shows how to use the following methods:setConversionService
 
		this.testBeanModelAttr = new MethodParameter(method, 0); 
		this.testBeanWithoutStringConstructorModelAttr = new MethodParameter(method, 1); 
		this.testBeanWithOptionalModelAttr = new MethodParameter(method, 2); 
 
		ConfigurableWebBindingInitializer initializer = new ConfigurableWebBindingInitializer(); 
		initializer.setConversionService(new DefaultConversionService()); 
 
		this.binderFactory = new ServletRequestDataBinderFactory(null, initializer); 
		this.mavContainer = new ModelAndViewContainer(); 
 
		this.request = new MockHttpServletRequest(); 
		this.webRequest = new ServletWebRequest(request); 
	} 
 
 
	@Test 
	public void createAttributeUriTemplateVar() throws Exception { 
		Map<String, String> uriTemplateVars = new HashMap<String, String>(); 
		uriTemplateVars.put("testBean1", "Patty"); 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setConversionService, setValidator
		AnnotationMethodHandlerAdapter adapter = new AnnotationMethodHandlerAdapter(); 
 
		ActionInterceptor[] interceptors = new ActionInterceptor[]{datastoreInterceptor}; 
		//adapter.setActionInterceptors(interceptors); 
 
		ConfigurableWebBindingInitializer wbi = new ConfigurableWebBindingInitializer(); 
		wbi.setValidator(getValidator()); 
		wbi.setConversionService(conversionService()); 
 
		adapter.setWebBindingInitializer(wbi); 
		adapter.setMessageConverters(getMessageConverters()); 
		adapter.setOrder(-1); 
		return adapter; 
	} 
 
	@Bean 
	public ConversionService conversionService() { 
		FormattingConversionServiceFactoryBean fb = new FormattingConversionServiceFactoryBean(); 
		fb.afterPropertiesSet(); 
		FormattingConversionService cs = fb.getObject(); 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setValidator
 
public abstract class ConfigSupport { 
 
	@Bean 
	public WebBindingInitializer initializer() { 
		ConfigurableWebBindingInitializer initializer = new ConfigurableWebBindingInitializer(); 
		initializer.setValidator(mvcValidator()); 
		return initializer; 
	} 
	 
	@Bean 
	Validator mvcValidator() { 
		return new LocalValidatorFactoryBean(); 
	} 
	 
	 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setConversionService
		assertEquals("", result); 
	} 
 
	@Test 
	public void resolveOptional() throws Exception { 
		ConfigurableWebBindingInitializer initializer = new ConfigurableWebBindingInitializer(); 
		initializer.setConversionService(new DefaultConversionService()); 
		WebDataBinderFactory binderFactory = new DefaultDataBinderFactory(initializer); 
 
		Object result = resolver.resolveArgument(paramOptional, null, webRequest, binderFactory); 
		assertEquals(Optional.class, result.getClass()); 
		assertEquals(Optional.empty(), result); 
 
		this.request.addParameter("name", "123"); 
		result = resolver.resolveArgument(paramOptional, null, webRequest, binderFactory); 
		assertEquals(Optional.class, result.getClass()); 
		assertEquals(123, ((Optional) result).get()); 
	} 
 
 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Spring Framework ConfigurableWebBindingInitializer Methods: