1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
3
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
|
4
|
xmlns:tx="http://www.springframework.org/schema/tx"
|
5
|
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
6
|
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
7
|
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
|
8
|
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
|
9
|
">
|
10
|
<context:component-scan base-package="eu/etaxonomy/cdm/remote" />
|
11
|
|
12
|
|
13
|
<!--
|
14
|
======= HandlerMappings =======
|
15
|
-->
|
16
|
<!--
|
17
|
first we try to find the controller using the simpleurlmapping, then
|
18
|
the classname this follows the principal of "convention over
|
19
|
configuration"
|
20
|
-->
|
21
|
<bean
|
22
|
class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
|
23
|
<property name="order" value="1" />
|
24
|
<property name="interceptors">
|
25
|
<list>
|
26
|
<ref bean="contentNegociationHandlerInterceptor" />
|
27
|
<ref bean="localeContextHandlerInterceptor" />
|
28
|
</list>
|
29
|
</property>
|
30
|
</bean>
|
31
|
|
32
|
<!--
|
33
|
<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
|
34
|
<property name="order" value="0" />
|
35
|
<property name="mappings">
|
36
|
<props>
|
37
|
<prop key="/index.do">urlFilenameViewController
|
38
|
</prop>
|
39
|
<prop key="/">welcomeFileViewController
|
40
|
</prop>
|
41
|
</props>
|
42
|
</property>
|
43
|
</bean>
|
44
|
-->
|
45
|
|
46
|
<!--
|
47
|
======= HandlerAdapters =======
|
48
|
-->
|
49
|
<bean
|
50
|
class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
|
51
|
</bean>
|
52
|
|
53
|
<!-- needed when using SimpleUrlHandlerMapping -->
|
54
|
<bean
|
55
|
class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter" />
|
56
|
|
57
|
|
58
|
<!--
|
59
|
======= HandlerInterceptors =======
|
60
|
-->
|
61
|
<!--
|
62
|
<bean id="datasourceContextHandlerInterceptor"
|
63
|
class="eu.etaxonomy.cdm.remote.controller.interceptor.DatasourceContextHandlerInterceptor" /> -->
|
64
|
<bean id="localeContextHandlerInterceptor"
|
65
|
class="eu.etaxonomy.cdm.remote.controller.interceptor.LocaleContextHandlerInterceptor" />
|
66
|
<bean id="contentNegociationHandlerInterceptor"
|
67
|
class="eu.etaxonomy.cdm.remote.controller.interceptor.ContentNegociationHandlerInterceptor">
|
68
|
<property name="mapping">
|
69
|
<map>
|
70
|
<entry key="text/json" value="json" />
|
71
|
<entry key="application/json" value="json" />
|
72
|
<entry key="application/xml" value="xml" />
|
73
|
</map>
|
74
|
</property>
|
75
|
<property name="defaultExtension" value="xml" />
|
76
|
</bean>
|
77
|
|
78
|
<!--
|
79
|
======= ViewControllers =======
|
80
|
-->
|
81
|
<bean id="urlFilenameViewController"
|
82
|
class="org.springframework.web.servlet.mvc.UrlFilenameViewController">
|
83
|
</bean>
|
84
|
<!--
|
85
|
The welcome-file-list in the web.xml will is ignored since the
|
86
|
cdmserver servlet is mapped to the root path [/] So the welcome file
|
87
|
list is being replaced by a SimpleUrlHandlerMapping on the root path
|
88
|
[/] which is mapped via this ViewController to the [index] view
|
89
|
<bean id="welcomeFileViewController"
|
90
|
class="org.springframework.web.servlet.mvc.UrlFilenameViewController">
|
91
|
<property name="suffix">
|
92
|
<value>index</value>
|
93
|
</property>
|
94
|
</bean>
|
95
|
-->
|
96
|
|
97
|
|
98
|
<!--
|
99
|
======= ViewResolver =======
|
100
|
-->
|
101
|
<!--
|
102
|
PatternViewResolver is Subclass of
|
103
|
org.springframework.web.servlet.view.XmlViewResolver which accepts a
|
104
|
configuration file. The default configuration file is
|
105
|
/WEB-INF/views.xml
|
106
|
-->
|
107
|
<bean name="viewResolver" class="eu.etaxonomy.cdm.remote.view.PatternViewResolver">
|
108
|
<property name="order" value="0" />
|
109
|
<!--
|
110
|
turn caching off FOR DEBUGING ONLY !!!!
|
111
|
<property name="cache" value="false"/>
|
112
|
-->
|
113
|
</bean>
|
114
|
|
115
|
<!--
|
116
|
=== the viewResolverJsp is currently unused ===
|
117
|
<bean id="viewResolverJsp"
|
118
|
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
|
119
|
<property name="order" value="1" />
|
120
|
<property name="prefix" value="/WEB-INF/jsp/" />
|
121
|
<property name="suffix" value=".jsp" />
|
122
|
<property name="viewNames">
|
123
|
<!- -
|
124
|
view names (or name patterns) that can be handled
|
125
|
- ->
|
126
|
<list>
|
127
|
<value>index</value>
|
128
|
</list>
|
129
|
</property>
|
130
|
</bean>
|
131
|
-->
|
132
|
|
133
|
<!--
|
134
|
======= Exception Handling =======
|
135
|
-->
|
136
|
<bean id="exceptionResolver" class="eu.etaxonomy.cdm.remote.exception.CdmExceptionResolver">
|
137
|
</bean>
|
138
|
|
139
|
<!--
|
140
|
======= Security =======
|
141
|
-->
|
142
|
<!-- <bean id="basicProcessingFilter" class="org.springframework.security.ui.basicauth.BasicProcessingFilter">-->
|
143
|
<!-- <property name="authenticationManager"><ref bean="authenticationManager"/></property>-->
|
144
|
<!-- <property name="authenticationEntryPoint"><ref bean="authenticationEntryPoint"/></property>-->
|
145
|
<!-- </bean>-->
|
146
|
<!-- <bean id="authenticationEntryPoint" class="org.springframework.security.ui.basicauth.BasicProcessingFilterEntryPoint">-->
|
147
|
<!-- <property name="realmName"><value>Name Of Your Realm</value></property>-->
|
148
|
<!-- </bean>-->
|
149
|
|
150
|
</beans>
|