aboutsummaryrefslogtreecommitdiff
path: root/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-10-18 17:52:08 +0300
committerGravatar Vitaly Takmazov2017-10-18 17:52:08 +0300
commitab1107c209edc34180397db4614ac3c185d6a52a (patch)
treeac0dfcfdf53369859950f48c756278e7261e9afe /juick-ws/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java
parent0b9d212606984602445437e919075ff2d790e256 (diff)
ws: httpclient -> RestTemplate
Diffstat (limited to 'juick-ws/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java')
-rw-r--r--juick-ws/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java17
1 files changed, 11 insertions, 6 deletions
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 c99d7a6d..b76545b8 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
@@ -25,25 +25,26 @@ 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.core.Ordered;
import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
+import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.config.annotation.ServletWebSocketHandlerRegistry;
import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;
import org.springframework.web.socket.server.standard.ServletServerContainerFactoryBean;
-import javax.annotation.Resource;
-import javax.inject.Inject;
-
/**
* Created by aalexeev on 11/24/16.
*/
@Configuration
-@ComponentScan(basePackages = {"com.juick.server.protocol"})
+@ComponentScan(basePackages = {"com.juick.ws.controllers"})
@EnableScheduling
@EnableWebSocket
+@EnableWebMvc
@PropertySource("classpath:juick.conf")
-class WebsocketConfiguration extends BaseWebConfiguration implements WebSocketConfigurer {
+public class WebsocketConfiguration extends BaseWebConfiguration implements WebSocketConfigurer {
@Bean
public XMPPConnection xmpp() {
return new XMPPConnection();
@@ -60,7 +61,7 @@ class WebsocketConfiguration extends BaseWebConfiguration implements WebSocketCo
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
- ((ServletWebSocketHandlerRegistry) registry).setOrder(2);
+ ((ServletWebSocketHandlerRegistry) registry).setOrder(Ordered.LOWEST_PRECEDENCE);
registry.addHandler(wsHandler(), "/**").setAllowedOrigins("*");
}
@@ -71,4 +72,8 @@ class WebsocketConfiguration extends BaseWebConfiguration implements WebSocketCo
container.setMaxBinaryMessageBufferSize(8192);
return container;
}
+ @Override
+ public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
+ configurer.enable();
+ }
}