Package org.springframework.http.server

Examples of org.springframework.http.server.ServerHttpRequest


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

    ServerHttpRequest request = new ServletServerHttpRequest(servletRequest);
    ServerHttpResponse response = new ServletServerHttpResponse(servletResponse);

    HandshakeInterceptorChain chain = new HandshakeInterceptorChain(this.interceptors, this.wsHandler);
    HandshakeFailureException failure = null;

    try {
      if (logger.isDebugEnabled()) {
        logger.debug(servletRequest.getMethod() + " " + servletRequest.getRequestURI());
      }
      Map<String, Object> attributes = new HashMap<String, Object>();
      if (!chain.applyBeforeHandshake(request, response, attributes)) {
        return;
      }
      this.handshakeHandler.doHandshake(request, response, this.wsHandler, attributes);
      chain.applyAfterHandshake(request, response, null);
      response.close();
    }
    catch (HandshakeFailureException ex) {
      failure = ex;
    }
    catch (Throwable ex) {
      failure = new HandshakeFailureException("Uncaught failure for request " + request.getURI(), ex);
    }
    finally {
      if (failure != null) {
        chain.applyAfterHandshake(request, response, failure);
        throw failure;
View Full Code Here


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

    ServerHttpRequest request = new ServletServerHttpRequest(servletRequest);
    ServerHttpResponse response = new ServletServerHttpResponse(servletResponse);

    try {
      this.sockJsService.handleRequest(request, response, getSockJsPath(servletRequest), this.webSocketHandler);
    }
    catch (Throwable ex) {
      throw new SockJsException("Uncaught failure in SockJS request, uri=" + request.getURI(), ex);
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.http.server.ServerHttpRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.