You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: jetty-websocket/websocket-server/src/main/java/org/eclipse/jetty/websocket/server/WebSocketUpgradeFilter.java
* Inline Servlet Filter to capture WebSocket upgrade requests and perform path mappings to {@link WebSocketCreator} objects.
49
+
* </p>
50
+
*
51
+
* <p>
52
+
* <em>Embedded Jetty Users</em> should initialize this filter using the {@link #configure(ServletContextHandler)} method.
53
+
* If you also want to establish some mappings of {@link PathSpec} to {@link WebSocketCreator} against this {@code WebSocketUpgradeFilter}
54
+
* then these actions must occur during the Servlet Initialization Phase.
55
+
* A convenience method is provided with {@link NativeWebSocketServletContainerInitializer#configure(ServletContextHandler, NativeWebSocketServletContainerInitializer.Configurator)}
56
+
* to create a lambda that will execute during the appropriate Servlet Initialization Phase.
57
+
* </p>
58
+
* <pre>
59
+
* ServletContextHandler contextHandler = new ServletContextHandler(...);
@@ -67,7 +87,7 @@ public class WebSocketUpgradeFilter implements Filter, MappedWebSocketCreator, D
67
87
* </p>
68
88
*
69
89
* @param context the {@link ServletContextHandler} to use
70
-
* @return the configured default {@link WebSocketUpgradeFilter} instance
90
+
* @return the configured default {@link WebSocketUpgradeFilter} instance, use this reference later in your Servlet Initialization Phase to establish mappings of websockets.
71
91
* @throws ServletException if the filer cannot be configured
0 commit comments