From 34d1411d80ce18807448e97ce21062122a9afaae Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 19 Jul 2016 16:20:03 +0300 Subject: juick-ws: add status page --- .../com/juick/ws/configuration/WebsocketConfiguration.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'juick-ws/src/main/java/com/juick/ws/configuration') 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 223f8d63..fbc6226b 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 @@ -10,7 +10,10 @@ import org.springframework.core.env.Environment; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.datasource.DriverManagerDataSource; import org.springframework.web.servlet.config.annotation.EnableWebMvc; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; +import org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping; +import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; import org.springframework.web.socket.config.annotation.EnableWebSocket; import org.springframework.web.socket.config.annotation.WebSocketConfigurer; import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry; @@ -23,11 +26,10 @@ import java.util.concurrent.Executors; * Created by vitalyster on 28.06.2016. */ @Configuration -@EnableWebMvc @EnableWebSocket @ComponentScan(basePackages = {"com.juick"}) @PropertySource("classpath:juick.conf") -public class WebsocketConfiguration extends WebMvcConfigurerAdapter implements WebSocketConfigurer { +public class WebsocketConfiguration extends WebMvcConfigurationSupport implements WebSocketConfigurer { @Inject Environment env; ExecutorService xmppThread = Executors.newSingleThreadExecutor(); @@ -49,6 +51,12 @@ public class WebsocketConfiguration extends WebMvcConfigurerAdapter implements W return new JdbcTemplate(dataSource); } @Override + public RequestMappingHandlerMapping requestMappingHandlerMapping() { + RequestMappingHandlerMapping mapping = super.requestMappingHandlerMapping(); + mapping.setUseSuffixPatternMatch(false); + return mapping; + } + @Override public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) { registry.addHandler(wsHandler(), "/**").setAllowedOrigins("*"); } -- cgit v1.2.3