diff options
author | Vitaly Takmazov | 2017-06-29 17:09:49 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2017-06-30 10:22:20 +0300 |
commit | c99b9350be030bfbf87829956a182753a81d07a2 (patch) | |
tree | 1485ea407aca135eee7815d93a3636ba793a0276 /juick-notifications | |
parent | b75b5a3d1a3bf001923d49923dcebee95ba2327e (diff) |
MVC was not enabled in apps based on BaseWebConfiguration
Diffstat (limited to 'juick-notifications')
2 files changed, 7 insertions, 21 deletions
diff --git a/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsAppConfiguration.java b/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsAppConfiguration.java index b8730bfb..b50edfd5 100644 --- a/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsAppConfiguration.java +++ b/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsAppConfiguration.java @@ -1,20 +1,16 @@ package com.juick.components.configuration; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; import com.juick.components.CleanUp; import com.juick.components.Notifications; +import com.juick.server.configuration.BaseWebConfiguration; import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.PropertySource; +import org.springframework.context.annotation.*; import org.springframework.http.client.ClientHttpRequestInterceptor; import org.springframework.http.client.InterceptingClientHttpRequestFactory; import org.springframework.http.client.support.BasicAuthorizationInterceptor; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.web.client.RestTemplate; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; import java.util.Collections; import java.util.List; @@ -26,7 +22,8 @@ import java.util.List; @EnableScheduling @PropertySource("classpath:juick.conf") @ComponentScan(basePackages = {"com.juick.components.service"}) -public class NotificationsAppConfiguration { +@Import(BaseWebConfiguration.class) +public class NotificationsAppConfiguration extends WebMvcConfigurationSupport { @Value("${api_user:juick}") private String apiUser; @Value("${api_password:secret}") @@ -48,16 +45,6 @@ public class NotificationsAppConfiguration { } @Bean - public ObjectMapper jsonMapper() { - ObjectMapper mapper = new ObjectMapper(); - mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY); - mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - mapper.setSerializationInclusion(JsonInclude.Include.NON_DEFAULT); - mapper.registerModule(new Jdk8Module()); - return mapper; - } - - @Bean public CleanUp cleanUp() { return new CleanUp(); } diff --git a/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsInitializer.java b/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsInitializer.java index 8ecf72ea..cc604b02 100644 --- a/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsInitializer.java +++ b/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsInitializer.java @@ -1,6 +1,5 @@ package com.juick.components.configuration; -import com.juick.server.configuration.BaseWebConfiguration; import org.apache.commons.codec.CharEncoding; import org.springframework.web.filter.CharacterEncodingFilter; import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; @@ -15,14 +14,14 @@ public class NotificationsInitializer extends AbstractAnnotationConfigDispatcher @Override protected Class<?>[] getRootConfigClasses() { return new Class<?>[]{ - NotificationsAppConfiguration.class, APNSConfiguration.class, MPNSConfiguration.class, + APNSConfiguration.class, MPNSConfiguration.class, GCMConfiguration.class, XMPPConfiguration.class }; } @Override protected Class<?>[] getServletConfigClasses() { - return new Class<?>[]{ BaseWebConfiguration.class }; + return new Class<?>[]{ NotificationsAppConfiguration.class }; } @Override |