Servlet
, ServletConfig
, WebSocketCreator
public class WebSocketChatServlet extends WebSocketServlet implements WebSocketCreator
Modifier and Type | Class | Description |
---|---|---|
class |
WebSocketChatServlet.ChatWebSocket |
Create a WebSocket that echo's back the message to all other members of the servlet.
|
Constructor | Description |
---|---|
WebSocketChatServlet() |
Modifier and Type | Method | Description |
---|---|---|
void |
configure(WebSocketServletFactory factory) |
|
java.lang.Object |
createWebSocket(ServletUpgradeRequest req,
ServletUpgradeResponse resp) |
Create a websocket from the incoming request.
|
protected void |
doGet(HttpServletRequest request,
HttpServletResponse response) |
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
destroy, init, service
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException
doGet
in class HttpServlet
ServletException
java.io.IOException
public java.lang.Object createWebSocket(ServletUpgradeRequest req, ServletUpgradeResponse resp)
WebSocketCreator
createWebSocket
in interface WebSocketCreator
req
- the request detailsresp
- the response detailspublic void configure(WebSocketServletFactory factory)
configure
in class WebSocketServlet
Copyright © 1995–2018 Webtide. All rights reserved.