1f4fe9cc6310671fd13242b3cf638216455f40db
[JavaForFun] /
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <beans xmlns="http://www.springframework.org/schema/beans"\r
3         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
4         xmlns:context="http://www.springframework.org/schema/context"\r
5         xmlns:util="http://www.springframework.org/schema/util"\r
6         xmlns:p="http://www.springframework.org/schema/p"\r
7         xsi:schemaLocation="http://www.springframework.org/schema/beans\r
8         http://www.springframework.org/schema/beans/spring-beans.xsd\r
9         http://www.springframework.org/schema/context\r
10         http://www.springframework.org/schema/context/spring-context.xsd\r
11         http://www.springframework.org/schema/util\r
12         http://www.springframework.org/schema/util/spring-util.xsd">\r
13         \r
14            \r
15         <context:annotation-config />\r
16    \r
17         <context:component-scan base-package="de.spring.webservices.rest"/>\r
18         \r
19         <context:property-placeholder location="classpath:rest.properties" />\r
20         \r
21         <bean id="jsonObjectMapperFactory" class="org.springframework.http.converter.json.Jackson2ObjectMapperFactoryBean" p:indentOutput="true" p:failOnEmptyBeans="false">\r
22         <property name="featuresToDisable">\r
23             <array>\r
24                 <util:constant static-field="com.fasterxml.jackson.databind.DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES"/>\r
25                 <util:constant static-field="com.fasterxml.jackson.databind.MapperFeature.DEFAULT_VIEW_INCLUSION"/>\r
26             </array>\r
27         </property>\r
28     </bean>\r
29 \r
30     <util:list id="messageConverters">\r
31         <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter" p:objectMapper-ref="jsonObjectMapperFactory"/>\r
32         <bean class="org.springframework.http.converter.StringHttpMessageConverter" />\r
33     </util:list>\r
34     \r
35         <bean id="restTemplate" class="org.springframework.web.client.RestTemplate">\r
36                     <constructor-arg ref="messageConverters" />\r
37         </bean>\r
38         \r
39 </beans>\r