SPR-6801 @ModelAttribute instantiation refinement.
Instantiate the model attribute from a URI var or a request param only if the name matches and there is a registered Converter<String, ?>.
This commit is contained in:
@@ -99,6 +99,14 @@ public class InitBinderDataBinderFactoryTests {
|
||||
assertNull(dataBinder.getDisallowedFields());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void createBinderNullAttrName() throws Exception {
|
||||
WebDataBinderFactory factory = createBinderFactory("initBinderWithAttributeName", WebDataBinder.class);
|
||||
WebDataBinder dataBinder = factory.createBinder(webRequest, null, null);
|
||||
|
||||
assertNull(dataBinder.getDisallowedFields());
|
||||
}
|
||||
|
||||
@Test(expected=IllegalStateException.class)
|
||||
public void returnValueNotExpected() throws Exception {
|
||||
WebDataBinderFactory factory = createBinderFactory("initBinderReturnValue", WebDataBinder.class);
|
||||
|
||||
Reference in New Issue
Block a user