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 --- .../com/juick/ws/configuration/WebsocketConfiguration.java | 10 +++++----- .../java/com/juick/ws/configuration/WebsocketInitializer.java | 5 ++--- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'juick-ws/src/main') diff --git a/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java b/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java index b7e0e658..4edca8c6 100644 --- a/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java +++ b/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java @@ -1,14 +1,13 @@ package com.juick.ws.configuration; +import com.juick.server.configuration.BaseWebConfiguration; import com.juick.server.protocol.JuickProtocol; import com.juick.ws.WebsocketComponent; import com.juick.ws.XMPPConnection; -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.core.env.Environment; import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; import org.springframework.web.socket.config.annotation.EnableWebSocket; import org.springframework.web.socket.config.annotation.ServletWebSocketHandlerRegistry; import org.springframework.web.socket.config.annotation.WebSocketConfigurer; @@ -25,7 +24,8 @@ import javax.inject.Inject; @EnableScheduling @EnableWebSocket @PropertySource("classpath:juick.conf") -class WebsocketConfiguration implements WebSocketConfigurer { +@Import(BaseWebConfiguration.class) +class WebsocketConfiguration extends WebMvcConfigurationSupport implements WebSocketConfigurer { @Inject private Environment env; diff --git a/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketInitializer.java b/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketInitializer.java index 21f51fcf..766ab454 100644 --- a/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketInitializer.java +++ b/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketInitializer.java @@ -1,7 +1,6 @@ package com.juick.ws.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 WebsocketInitializer extends AbstractAnnotationConfigDispatcherServ @Override protected Class[] getRootConfigClasses() { - return new Class[]{WebsocketConfiguration.class, DataConfiguration.class}; + return new Class[]{ DataConfiguration.class }; } @Override protected Class[] getServletConfigClasses() { - return new Class[]{ BaseWebConfiguration.class }; + return new Class[]{ WebsocketConfiguration.class }; } @Override -- cgit v1.2.3