org.springframework.web.socket.sockjs.support

## Class SockJsHttpRequestHandler

- java.lang.Object
- - org.springframework.web.socket.sockjs.support.SockJsHttpRequestHandler

- All Implemented Interfaces:
    HttpRequestHandler

      public class SockJsHttpRequestHandler
      extends Object
      implements HttpRequestHandler

  An `HttpRequestHandler` that allows mapping a `SockJsService` to requests in a Servlet container.
  Since:
    4.0
  Author:
    Rossen Stoyanchev

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SockJsHttpRequestHandler(SockJsService sockJsService, WebSocketHandler webSocketHandler)` Create a new SockJsHttpRequestHandler.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `SockJsService` | `getSockJsService()` Return the `SockJsService`.
    `WebSocketHandler` | `getWebSocketHandler()` Return the `WebSocketHandler`.
    `void` | `handleRequest(HttpServletRequest servletRequest, HttpServletResponse servletResponse)` Process the given request, generating a response.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SockJsHttpRequestHandler

          public SockJsHttpRequestHandler(SockJsService sockJsService,
                                          WebSocketHandler webSocketHandler)

      Create a new SockJsHttpRequestHandler.
      Parameters:
        `sockJsService` - the SockJS service
        `webSocketHandler` - the websocket handler

  - ### Method Detail

    - #### getSockJsService

          public SockJsService getSockJsService()

      Return the `SockJsService`.

    - #### getWebSocketHandler

          public WebSocketHandler getWebSocketHandler()

      Return the `WebSocketHandler`.

    - #### handleRequest

          public void handleRequest(HttpServletRequest servletRequest,
                                    HttpServletResponse servletResponse)
                             throws ServletException,
                                    IOException

      Description copied from interface: `HttpRequestHandler`
      Process the given request, generating a response.
      Specified by:
        `handleRequest` in interface `HttpRequestHandler`
      Parameters:
        `servletRequest` - current HTTP request
        `servletResponse` - current HTTP response
      Throws:
        `ServletException` - in case of general errors
        `IOException` - in case of I/O errors