Commit 12cefd2c authored by Stephane Nicoll's avatar Stephane Nicoll

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
parent 835a11b5
......@@ -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();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment