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:p="http://www.springframework.org/schema/p"
|
4
|
xmlns:mvc="http://www.springframework.org/schema/mvc"
|
5
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
6
|
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
|
7
|
|
8
|
<bean id="vocTemplateViewResolver"
|
9
|
class="eu.dnetlib.springutils.stringtemplate.StringTemplateViewResolver"
|
10
|
p:cache="false" p:templateGroup-ref="vocTemplateGroup" p:contentType="text/html;charset=UTF-8" />
|
11
|
|
12
|
<bean id="vocTemplateGroup"
|
13
|
class="eu.dnetlib.springutils.stringtemplate.ClassPathStringTemplateGroup"
|
14
|
p:refreshInterval="0" p:package="eu.dnetlib.vocabularies.views">
|
15
|
<constructor-arg type="java.lang.String" value="vocabularies" />
|
16
|
</bean>
|
17
|
|
18
|
<!-- Select the views based on the Accept header or the path extension.
|
19
|
It is not working with the parameter ?format=json, but I do not know why -->
|
20
|
<bean id="contentNegotiationManager"
|
21
|
class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean">
|
22
|
<property name="defaultContentType" value="text/html" />
|
23
|
<property name="favorParameter" value="true" />
|
24
|
<property name="parameterName" value="format" />
|
25
|
<property name="mediaTypes">
|
26
|
<map>
|
27
|
<entry key="json" value="application/json" />
|
28
|
<entry key="html" value="text/html" />
|
29
|
</map>
|
30
|
</property>
|
31
|
</bean>
|
32
|
|
33
|
<!-- <bean id="contentNegotiationManager" -->
|
34
|
<!-- class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean"> -->
|
35
|
<!-- <property name="favorPathExtension" value="false" /> -->
|
36
|
<!-- <property name="favorParameter" value="true" /> -->
|
37
|
<!-- <property name="parameterName" value="format" /> -->
|
38
|
<!-- <property name="ignoreAcceptHeader" value="true" /> -->
|
39
|
<!-- <property name="useJaf" value="false" /> -->
|
40
|
<!-- <property name="defaultContentType" value="application/json" /> -->
|
41
|
|
42
|
<!-- <property name="mediaTypes"> -->
|
43
|
<!-- <map> -->
|
44
|
<!-- <entry key="json" value="application/json" /> -->
|
45
|
<!-- <entry key="xml" value="application/xml" /> -->
|
46
|
<!-- <entry key="html" value="text/html" /> -->
|
47
|
<!-- </map> -->
|
48
|
<!-- </property> -->
|
49
|
<!-- </bean> -->
|
50
|
|
51
|
<mvc:annotation-driven
|
52
|
content-negotiation-manager="contentNegotiationManager">
|
53
|
</mvc:annotation-driven>
|
54
|
|
55
|
|
56
|
|
57
|
|
58
|
|
59
|
|
60
|
</beans>
|