public class SockJsHttpRequestHandler extends Object implements HttpRequestHandler
HttpRequestHandler for processing SockJS requests. This is the main class
to use when configuring a SockJS service at a specific URL. It is a very thin wrapper
around a SockJsService and a WebSocketHandler instance also adapting
the HttpServletRequest and HttpServletResponse to
ServerHttpRequest and ServerHttpResponse respectively.
The decorateWebSocketHandler(WebSocketHandler) method decorates the given
WebSocketHandler with a logging and exception handling decorators. This method can be
overridden to change that.
| Constructor and Description |
|---|
SockJsHttpRequestHandler(SockJsService sockJsService,
WebSocketHandler webSocketHandler)
Create a new
SockJsHttpRequestHandler. |
| Modifier and Type | Method and Description |
|---|---|
protected WebSocketHandler |
decorateWebSocketHandler(WebSocketHandler handler)
Decorate the WebSocketHandler provided to the class constructor.
|
void |
handleRequest(HttpServletRequest request,
HttpServletResponse response)
Process the given request, generating a response.
|
public SockJsHttpRequestHandler(SockJsService sockJsService, WebSocketHandler webSocketHandler)
SockJsHttpRequestHandler.sockJsService - the SockJS servicewebSocketHandler - the websocket handlerprotected WebSocketHandler decorateWebSocketHandler(WebSocketHandler handler)
By default ExceptionWebSocketHandlerDecorator and
LoggingWebSocketHandlerDecorator are applied are added.
public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
HttpRequestHandlerhandleRequest in interface HttpRequestHandlerrequest - current HTTP requestresponse - current HTTP responseServletException - in case of general errorsIOException - in case of I/O errors