Code example for ServletWebRequest

0
 
		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"); 
		this.request.setAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE, uriTemplateVars); 
 
		// Type conversion from "Patty" to TestBean via TestBean(String) constructor 
 
		TestBean testBean = 
			(TestBean) this.processor.resolveArgument( 
					this.testBeanModelAttr, this.mavContainer, this.webRequest, this.binderFactory);