From 12cefd2c2b926103340e2245f16fb4930681f955 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Mon, 28 Dec 2015 13:49:12 +0100 Subject: [PATCH] Only enable Tomcat's websocket support on Java7+ Tomcat's websocket support requires Java7 or later. That commit makes sure to register its support only when such requirement is met. Closes gh-4846 --- .../autoconfigure/websocket/WebSocketAutoConfiguration.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/WebSocketAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/WebSocketAutoConfiguration.java index 302d3e94dc..d4f5f84968 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/WebSocketAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/WebSocketAutoConfiguration.java @@ -24,6 +24,7 @@ import org.eclipse.jetty.websocket.jsr356.server.deploy.WebSocketServerContainer import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnJava; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration; import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer; @@ -61,6 +62,7 @@ public class WebSocketAutoConfiguration { @Bean @ConditionalOnMissingBean(name = "websocketContainerCustomizer") + @ConditionalOnJava(ConditionalOnJava.JavaVersion.SEVEN) public EmbeddedServletContainerCustomizer websocketContainerCustomizer() { return new TomcatWebSocketContainerCustomizer(); }