aboutsummaryrefslogtreecommitdiff
path: root/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsMvcConfiguration.java
blob: 3d828832f0521a3b08cb76d20c7fb0c8128dd84a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package com.juick.components.configuration;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

import javax.inject.Inject;
import java.util.List;

/**
 * Created by vitalyster on 28.06.2016.
 */
@Configuration
@ComponentScan(basePackages = {"com.juick.components.controllers"})
public class NotificationsMvcConfiguration extends WebMvcConfigurationSupport {
    @Inject
    ObjectMapper jsonMapper;

    @Override
    protected void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
        MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter(jsonMapper);
        converters.add(converter);
        super.configureMessageConverters(converters);
    }
}