Merge branch 'release/5.29.0'
[cdmlib.git] / cdmlib-remote-webapp / src / main / java / eu / etaxonomy / cdm / remote / config / PreloadedBeans.java
1 /**
2 * Copyright (C) 2014 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
8 */
9 package eu.etaxonomy.cdm.remote.config;
10
11 import org.springframework.context.annotation.Bean;
12 import org.springframework.context.annotation.Configuration;
13
14 import com.fasterxml.jackson.databind.DeserializationFeature;
15 import com.fasterxml.jackson.databind.MapperFeature;
16 import com.fasterxml.jackson.databind.ObjectMapper;
17
18 import eu.etaxonomy.cdm.remote.controller.interceptor.LocaleContextHandlerInterceptor;
19
20 /**
21 * @author a.kohlbecker
22 * @since Jul 28, 2014
23 */
24 @Configuration
25 public class PreloadedBeans {
26
27 @Bean
28 public LocaleContextHandlerInterceptor getlocaleContextHandlerInterceptor(){
29 return new LocaleContextHandlerInterceptor();
30 }
31
32 /**
33 * This is only used for Converters so far
34 */
35 @Bean
36 public ObjectMapper objectMapper() {
37 ObjectMapper mapper = new ObjectMapper();
38 mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
39 mapper.configure(MapperFeature.DEFAULT_VIEW_INCLUSION, true);
40
41 return mapper;
42 }
43
44 }