Package rocket.remoting.client

Examples of rocket.remoting.client.WebResponse


  public WebResponse doRequest(final WebRequest webRequest) throws FailedWebRequestException {
    try {
      final HttpServletRequest request = this.getThreadLocalRequest();
      final HttpServletResponse response = this.getThreadLocalResponse();

      final WebResponse webResponse = this.doRequest0(request, response, webRequest);
      return webResponse;
    } catch (final FailedWebRequestException caught) {
      this.log(caught.getMessage(), caught);
      throw caught;
    }
View Full Code Here


      final RequestDispatcher dispatcher = request.getRequestDispatcher(url);
      dispatcher.include(request0, response0);
      response0.flushBuffer();

      final WebResponse webResponse = new WebResponse();
      webResponse.setCode(response0.getStatus());
      webResponse.setMessage(response0.getMessage());
      // @originalWidget not needed for now
      // webResponse.setHeaders(response0.getHeaders());

      final byte[] bytes = response0.toByteArray();
      final String characterEncoding = response0.getCharacterEncoding();
      final String text = null == characterEncoding ? new String(bytes) : new String(bytes, characterEncoding);
      webResponse.setBody(text);
      return webResponse;
    } catch (final Exception caught) {
      caught.printStackTrace();
      throw new FailedWebRequestException(caught.getMessage(), caught);
    }
View Full Code Here

TOP

Related Classes of rocket.remoting.client.WebResponse

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.