1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.web.bind;
17
18 import org.kuali.rice.krad.web.form.UifFormBase;
19 import org.springframework.web.bind.ServletRequestDataBinder;
20 import org.springframework.web.bind.support.WebBindingInitializer;
21 import org.springframework.web.context.request.NativeWebRequest;
22 import org.springframework.web.method.support.InvocableHandlerMethod;
23 import org.springframework.web.servlet.mvc.method.annotation.ServletRequestDataBinderFactory;
24
25 import java.util.List;
26
27
28
29
30 public class UifServletRequestDataBinderFactory extends ServletRequestDataBinderFactory {
31
32
33
34
35
36
37
38 public UifServletRequestDataBinderFactory(List<InvocableHandlerMethod> binderMethods,
39 WebBindingInitializer initializer) {
40 super(binderMethods, initializer);
41 }
42
43 @Override
44 protected ServletRequestDataBinder createBinderInstance(Object target, String objectName,
45 NativeWebRequest request) {
46 if (target != null) {
47
48
49 if (target instanceof UifFormBase) {
50 return new UifServletRequestDataBinder(target, objectName);
51 }
52 }
53
54 return super.createBinderInstance(target, objectName, request);
55 }
56 }