Revision 47a15e28
Added by Andreas Kohlbecker over 12 years ago
cdmlib-remote-webapp/src/main/webapp/WEB-INF/cdmlib-remote-servlet.xml | ||
---|---|---|
1 | 1 |
<?xml version="1.0" encoding="UTF-8"?> |
2 | 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
|
|
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 | 6 |
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd |
7 | 7 |
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd |
8 | 8 |
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd |
9 | 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 -->
|
|
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 | 54 |
<bean class="eu.etaxonomy.cdm.remote.controller.util.CdmAntPathMatcher" /> |
55 | 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 |
<!--
|
|
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 | 106 |
======= ViewResolver ======= |
107 | 107 |
--> |
108 |
|
|
108 |
|
|
109 | 109 |
<bean id="viewResolverJsp" |
110 | 110 |
class="org.springframework.web.servlet.view.InternalResourceViewResolver"> |
111 | 111 |
<property name="order" value="0" /> |
... | ... | |
121 | 121 |
</property> |
122 | 122 |
</bean> |
123 | 123 |
|
124 |
<bean id="oaiViewResolver" class="org.springframework.web.servlet.view.XmlViewResolver">
|
|
124 |
<bean id="oaiViewResolver" class="org.springframework.web.servlet.view.XmlViewResolver">
|
|
125 | 125 |
<property name="order" value="1"/> |
126 | 126 |
<property name="location" value="/WEB-INF/oai-views.xml"/> |
127 |
<!-- FOR DEBUGING ONLY !!!!
|
|
128 |
<property name="cache" value="false"/>
|
|
127 |
<!-- FOR DEBUGING ONLY !!!! |
|
128 |
<property name="cache" value="false"/> |
|
129 | 129 |
--> |
130 | 130 |
</bean> |
131 | 131 |
|
132 | 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 ======= |
|
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 |
</map> |
|
141 |
</property> |
|
142 |
<property name="viewResolvers"> |
|
143 |
<list> |
|
144 |
<bean id="xmlTypeViewResolver" class="eu.etaxonomy.cdm.remote.view.PatternViewResolver"> |
|
145 |
<property name="location" value="/WEB-INF/xml-views.xml"/> |
|
146 |
<!-- |
|
147 |
turn caching off FOR DEBUGING ONLY !!!! |
|
148 |
<property name="cache" value="false"/> |
|
149 |
--> |
|
150 |
</bean> |
|
151 |
<bean id="jsonTypeViewResolver" class="eu.etaxonomy.cdm.remote.view.PatternViewResolver"> |
|
152 |
<property name="location" value="/WEB-INF/json-views.xml"/> |
|
153 |
<!-- |
|
154 |
turn caching off FOR DEBUGING ONLY !!!! |
|
155 |
<property name="cache" value="false"/> |
|
156 |
--> |
|
157 |
</bean> |
|
158 |
</list> |
|
159 |
</property> |
|
160 |
</bean> |
|
161 |
|
|
162 |
<!-- |
|
163 |
======= Exception Handling ======= |
|
164 |
--> |
|
165 |
<bean id="exceptionResolver" class="eu.etaxonomy.cdm.remote.exception.CdmExceptionResolver"> |
|
166 |
</bean> |
|
167 |
|
|
168 |
<!-- |
|
169 |
======= Security ======= |
|
171 | 170 |
--> |
172 | 171 |
<!-- <bean id="basicProcessingFilter" class="org.springframework.security.ui.basicauth.BasicProcessingFilter">--> |
173 | 172 |
<!-- <property name="authenticationManager"><ref bean="authenticationManager"/></property>--> |
... | ... | |
176 | 175 |
<!-- <bean id="authenticationEntryPoint" class="org.springframework.security.ui.basicauth.BasicProcessingFilterEntryPoint">--> |
177 | 176 |
<!-- <property name="realmName"><value>Name Of Your Realm</value></property>--> |
178 | 177 |
<!-- </bean>--> |
179 |
|
|
178 |
|
|
180 | 179 |
</beans> |
Also available in: Unified diff
fixing #2565 (DataPortal CacheBot is broken)