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
|
<property name="pathMatcher">
|
31
|
<!-- must match the pathMatcher as set in AnnotationMethodHandlerAdapter -->
|
32
|
<bean class="eu.etaxonomy.cdm.remote.controller.util.CdmAntPathMatcher" />
|
33
|
</property>
|
34
|
</bean>
|
35
|
|
36
|
<!--
|
37
|
-->
|
38
|
<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
|
39
|
<property name="order" value="0" />
|
40
|
<property name="mappings">
|
41
|
<props>
|
42
|
<prop key="/index.do">urlFilenameViewController</prop>
|
43
|
<prop key="/">welcomeFileViewController</prop>
|
44
|
</props>
|
45
|
</property>
|
46
|
</bean>
|
47
|
|
48
|
<!--
|
49
|
======= HandlerAdapters =======
|
50
|
-->
|
51
|
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
|
52
|
<property name="pathMatcher">
|
53
|
<!-- must match the pathMatcher as set in DefaultAnnotationHandlerMapping -->
|
54
|
<bean class="eu.etaxonomy.cdm.remote.controller.util.CdmAntPathMatcher" />
|
55
|
</property>
|
56
|
</bean>
|
57
|
|
58
|
<!-- needed when using SimpleUrlHandlerMapping -->
|
59
|
<bean
|
60
|
class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter" />
|
61
|
|
62
|
|
63
|
<!--
|
64
|
======= HandlerInterceptors =======
|
65
|
-->
|
66
|
<!--
|
67
|
<bean id="datasourceContextHandlerInterceptor"
|
68
|
class="eu.etaxonomy.cdm.remote.controller.interceptor.DatasourceContextHandlerInterceptor" /> -->
|
69
|
<bean id="localeContextHandlerInterceptor"
|
70
|
class="eu.etaxonomy.cdm.remote.controller.interceptor.LocaleContextHandlerInterceptor" />
|
71
|
<!--
|
72
|
=== no longer needed, replaced by ContentNegotiatingViewResolver ==
|
73
|
<bean id="contentNegociationHandlerInterceptor"
|
74
|
class="eu.etaxonomy.cdm.remote.controller.interceptor.ContentNegociationHandlerInterceptor">
|
75
|
<property name="mapping">
|
76
|
<map>
|
77
|
<entry key="text/json" value="json" />
|
78
|
<entry key="application/json" value="json" />
|
79
|
<entry key="application/xml" value="xml" />
|
80
|
</map>
|
81
|
</property>
|
82
|
<property name="defaultExtension" value="xml" />
|
83
|
</bean>
|
84
|
-->
|
85
|
|
86
|
<!--
|
87
|
======= ViewControllers =======
|
88
|
-->
|
89
|
<bean id="urlFilenameViewController" class="org.springframework.web.servlet.mvc.UrlFilenameViewController">
|
90
|
</bean>
|
91
|
<!--
|
92
|
The welcome-file-list in the web.xml will is ignored since the
|
93
|
cdmserver servlet is mapped to the root path [/] So the welcome file
|
94
|
list is being replaced by a SimpleUrlHandlerMapping on the root path
|
95
|
[/] which is mapped via this ViewController to the [index] view
|
96
|
-->
|
97
|
<bean id="welcomeFileViewController"
|
98
|
class="org.springframework.web.servlet.mvc.UrlFilenameViewController">
|
99
|
<property name="suffix">
|
100
|
<value>index</value>
|
101
|
</property>
|
102
|
</bean>
|
103
|
|
104
|
|
105
|
<!--
|
106
|
======= ViewResolver =======
|
107
|
-->
|
108
|
|
109
|
<bean id="viewResolverJsp"
|
110
|
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
|
111
|
<property name="order" value="0" />
|
112
|
<property name="prefix" value="/WEB-INF/jsp/" />
|
113
|
<property name="suffix" value=".jsp" />
|
114
|
<property name="viewNames">
|
115
|
<!--
|
116
|
view names (or name patterns) that can be handled
|
117
|
-->
|
118
|
<list>
|
119
|
<value>index</value>
|
120
|
</list>
|
121
|
</property>
|
122
|
</bean>
|
123
|
|
124
|
<bean id="oaiViewResolver" class="org.springframework.web.servlet.view.XmlViewResolver">
|
125
|
<property name="order" value="1"/>
|
126
|
<property name="location" value="/WEB-INF/oai-views.xml"/>
|
127
|
<!-- FOR DEBUGING ONLY !!!!
|
128
|
<property name="cache" value="false"/>
|
129
|
-->
|
130
|
</bean>
|
131
|
|
132
|
<bean id="contentNegotiatingViewResolver" class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
|
133
|
<property name="order" value="2" />
|
134
|
<property name="mediaTypes">
|
135
|
<map>
|
136
|
<entry key="xml" value="application/xml" />
|
137
|
<entry key="dc" value="application/xml" />
|
138
|
<entry key="rdf" value="application/xml" />
|
139
|
<entry key="json" value="application/json" />
|
140
|
<entry key="json" value="application/json" />
|
141
|
</map>
|
142
|
</property>
|
143
|
<property name="viewResolvers">
|
144
|
<list>
|
145
|
<bean id="xmlTypeViewResolver" class="eu.etaxonomy.cdm.remote.view.PatternViewResolver">
|
146
|
<property name="location" value="/WEB-INF/xml-views.xml"/>
|
147
|
<!--
|
148
|
turn caching off FOR DEBUGING ONLY !!!!
|
149
|
<property name="cache" value="false"/>
|
150
|
-->
|
151
|
</bean>
|
152
|
<bean id="jsonTypeViewResolver" class="eu.etaxonomy.cdm.remote.view.PatternViewResolver">
|
153
|
<property name="location" value="/WEB-INF/json-views.xml"/>
|
154
|
<!--
|
155
|
turn caching off FOR DEBUGING ONLY !!!!
|
156
|
<property name="cache" value="false"/>
|
157
|
-->
|
158
|
</bean>
|
159
|
</list>
|
160
|
</property>
|
161
|
</bean>
|
162
|
|
163
|
<!--
|
164
|
======= Exception Handling =======
|
165
|
-->
|
166
|
<bean id="exceptionResolver" class="eu.etaxonomy.cdm.remote.exception.CdmExceptionResolver">
|
167
|
</bean>
|
168
|
|
169
|
<!--
|
170
|
======= Security =======
|
171
|
-->
|
172
|
<!-- <bean id="basicProcessingFilter" class="org.springframework.security.ui.basicauth.BasicProcessingFilter">-->
|
173
|
<!-- <property name="authenticationManager"><ref bean="authenticationManager"/></property>-->
|
174
|
<!-- <property name="authenticationEntryPoint"><ref bean="authenticationEntryPoint"/></property>-->
|
175
|
<!-- </bean>-->
|
176
|
<!-- <bean id="authenticationEntryPoint" class="org.springframework.security.ui.basicauth.BasicProcessingFilterEntryPoint">-->
|
177
|
<!-- <property name="realmName"><value>Name Of Your Realm</value></property>-->
|
178
|
<!-- </bean>-->
|
179
|
|
180
|
</beans>
|