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