Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

cdmlib / cdmlib-remote-webapp / src / main / webapp / WEB-INF / cdmlib-remote-servlet.xml @ e5846a95

History | View | Annotate | Download (6.13 KB)

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
  <!--
73
   ======= ViewControllers =======
74
   -->
75
  <bean id="urlFilenameViewController" class="org.springframework.web.servlet.mvc.UrlFilenameViewController">
76
  </bean>
77
  <!--
78
    The welcome-file-list in the web.xml will is ignored since the
79
    cdmserver servlet is mapped to the root path [/] So the welcome file
80
    list is being replaced by a SimpleUrlHandlerMapping on the root path
81
    [/] which is mapped via this ViewController to the [index] view
82
  -->
83
  <bean id="welcomeFileViewController"
84
    class="org.springframework.web.servlet.mvc.UrlFilenameViewController">
85
    <property name="suffix">
86
      <value>index</value>
87
    </property>
88
  </bean>
89

    
90

    
91
  <!--
92
    ======= ViewResolver =======
93
    -->
94

    
95
    <bean id="viewResolverJsp"
96
        class="org.springframework.web.servlet.view.InternalResourceViewResolver">
97
        <property name="order" value="0" />
98
        <property name="prefix" value="/WEB-INF/jsp/" />
99
        <property name="suffix" value=".jsp" />
100
        <property name="viewNames">
101
            <!--
102
                view names (or name patterns) that can be handled
103
            -->
104
            <list>
105
                <value>index</value>
106
            </list>
107
        </property>
108
    </bean>
109

    
110
  <bean id="oaiViewResolver" class="org.springframework.web.servlet.view.XmlViewResolver">
111
        <property name="order" value="1"/>
112
        <property name="location" value="/WEB-INF/oai-views.xml"/>
113
        <!-- FOR DEBUGING ONLY !!!!
114
        <property name="cache" value="false"/>
115
         -->
116
    </bean>
117

    
118
    <bean id="contentNegotiatingViewResolver" class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
119
        <property name="order" value="2" />
120
        <property name="mediaTypes">
121
           <map>
122
            <entry key="xml" value="application/xml" />
123
            <entry key="dc" value="application/xml" />
124
            <entry key="rdf" value="application/xml" />
125
            <entry key="json" value="application/json" />
126
           </map>
127
        </property>
128
        <property name="viewResolvers">
129
            <list>
130
          <bean id="xmlTypeViewResolver" class="eu.etaxonomy.cdm.remote.view.PatternViewResolver">
131
              <property name="location" value="/WEB-INF/xml-views.xml"/>
132
              <!--
133
                  turn caching off FOR DEBUGING ONLY !!!!
134
              <property name="cache" value="false"/>
135
              -->
136
          </bean>
137
          <bean id="jsonTypeViewResolver" class="eu.etaxonomy.cdm.remote.view.PatternViewResolver">
138
              <property name="location" value="/WEB-INF/json-views.xml"/>
139
              <!--
140
                turn caching off FOR DEBUGING ONLY !!!!
141
              <property name="cache" value="false"/>
142
              -->
143
          </bean>
144
            </list>
145
        </property>
146
  </bean>
147

    
148
  <!--
149
  ======= Exception Handling =======
150
  -->
151
  <bean id="exceptionResolver" class="eu.etaxonomy.cdm.remote.exception.CdmExceptionResolver">
152
  </bean>
153

    
154
  <!--
155
    ======= Security =======
156
    -->
157
<!--    <bean id="basicProcessingFilter" class="org.springframework.security.ui.basicauth.BasicProcessingFilter">-->
158
<!--                <property name="authenticationManager"><ref bean="authenticationManager"/></property>-->
159
<!--                <property name="authenticationEntryPoint"><ref bean="authenticationEntryPoint"/></property>-->
160
<!--        </bean>-->
161
<!--        <bean id="authenticationEntryPoint" class="org.springframework.security.ui.basicauth.BasicProcessingFilterEntryPoint">-->
162
<!--                <property name="realmName"><value>Name Of Your Realm</value></property>-->
163
<!--        </bean>-->
164

    
165
</beans>
Add picture from clipboard (Maximum size: 40 MB)