aboutsummaryrefslogtreecommitdiff
path: root/juick-ws/src/main/java/com/juick/ws/configuration/WebsocketConfiguration.java
diff options
context:
space:
mode:
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();
+ }
}