From c99b9350be030bfbf87829956a182753a81d07a2 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 29 Jun 2017 17:09:49 +0300 Subject: MVC was not enabled in apps based on BaseWebConfiguration --- .../juick/components/configuration/CrosspostAppConfiguration.java | 6 +++++- .../com/juick/components/configuration/CrosspostInitializer.java | 5 ++--- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'juick-crosspost/src/main/java/com/juick/components') diff --git a/juick-crosspost/src/main/java/com/juick/components/configuration/CrosspostAppConfiguration.java b/juick-crosspost/src/main/java/com/juick/components/configuration/CrosspostAppConfiguration.java index 2fcd3bfe..cd2887bb 100644 --- a/juick-crosspost/src/main/java/com/juick/components/configuration/CrosspostAppConfiguration.java +++ b/juick-crosspost/src/main/java/com/juick/components/configuration/CrosspostAppConfiguration.java @@ -1,11 +1,14 @@ package com.juick.components.configuration; import com.juick.components.Crosspost; +import com.juick.server.configuration.BaseWebConfiguration; import com.juick.service.CrosspostService; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; import org.springframework.context.annotation.PropertySource; import org.springframework.core.env.Environment; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; import org.springframework.web.socket.client.WebSocketConnectionManager; import org.springframework.web.socket.client.standard.StandardWebSocketClient; @@ -16,7 +19,8 @@ import javax.inject.Inject; */ @Configuration @PropertySource("classpath:juick.conf") -public class CrosspostAppConfiguration { +@Import(BaseWebConfiguration.class) +public class CrosspostAppConfiguration extends WebMvcConfigurationSupport { @Inject private Environment env; @Inject diff --git a/juick-crosspost/src/main/java/com/juick/components/configuration/CrosspostInitializer.java b/juick-crosspost/src/main/java/com/juick/components/configuration/CrosspostInitializer.java index 8eaab803..2dad77a6 100644 --- a/juick-crosspost/src/main/java/com/juick/components/configuration/CrosspostInitializer.java +++ b/juick-crosspost/src/main/java/com/juick/components/configuration/CrosspostInitializer.java @@ -1,7 +1,6 @@ package com.juick.components.configuration; import com.juick.configuration.DataConfiguration; -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,12 +14,12 @@ public class CrosspostInitializer extends AbstractAnnotationConfigDispatcherServ @Override protected Class[] getRootConfigClasses() { - return new Class[]{CrosspostAppConfiguration.class, DataConfiguration.class}; + return new Class[]{ DataConfiguration.class }; } @Override protected Class[] getServletConfigClasses() { - return new Class[]{BaseWebConfiguration.class}; + return new Class[]{ CrosspostAppConfiguration.class }; } @Override -- cgit v1.2.3