1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kns.web.spring; |
17 | |
|
18 | |
import javax.servlet.http.HttpServletRequest; |
19 | |
|
20 | |
import org.kuali.rice.kns.service.KNSServiceLocatorWeb; |
21 | |
import org.kuali.rice.kns.uif.service.ViewService; |
22 | |
import org.kuali.rice.kns.web.spring.form.UifFormBase; |
23 | |
import org.springframework.web.bind.ServletRequestDataBinder; |
24 | |
import org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter; |
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | 0 | public class UifAnnotationMethodHandleAdapter extends AnnotationMethodHandlerAdapter { |
33 | |
|
34 | |
protected ViewService viewService; |
35 | |
|
36 | |
@Override |
37 | |
protected ServletRequestDataBinder createBinder(HttpServletRequest request, Object target, String objectName) throws Exception { |
38 | 0 | if (target != null) { |
39 | |
|
40 | |
|
41 | 0 | if (target instanceof UifFormBase) { |
42 | |
|
43 | 0 | return new UifServletRequestDataBinder(target, objectName); |
44 | |
} |
45 | |
} |
46 | 0 | return super.createBinder(request, target, objectName); |
47 | |
} |
48 | |
|
49 | |
public ViewService getViewService() { |
50 | 0 | if(viewService == null) { |
51 | 0 | viewService = KNSServiceLocatorWeb.getViewService(); |
52 | |
} |
53 | 0 | return this.viewService; |
54 | |
} |
55 | |
|
56 | |
public void setViewService(ViewService viewService) { |
57 | 0 | this.viewService = viewService; |
58 | 0 | } |
59 | |
|
60 | |
} |