From 6f6eb3d9963f4cbe46249efc0dccb99ddd465b3b Mon Sep 17 00:00:00 2001 From: ghostg00 <546342424@qq.com> Date: Fri, 24 Mar 2023 14:34:23 +0800 Subject: [PATCH] Fix example in Javadoc for @EnableWebSocket The `echoWebSocketHandler()` method is not defined in the `WebSocketConfigurer` interface and should therefore be annotated with `@Bean` instead of `@Override`. Closes gh-30187 --- .../web/socket/config/annotation/EnableWebSocket.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/EnableWebSocket.java b/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/EnableWebSocket.java index 85a0f781eb9..2c406ea8a5d 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/EnableWebSocket.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/EnableWebSocket.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,7 @@ import org.springframework.context.annotation.Import; * registry.addHandler(echoWebSocketHandler(), "/echo").withSockJS(); * } * - * @Override + * @Bean * public WebSocketHandler echoWebSocketHandler() { * return new EchoWebSocketHandler(); * }