code: protected void buildHttpResponse(HttpServletResponse httpServletResponse,
              NaviRpcResponse response, String contentType, String encoding) throws IOException {
          httpServletResponse.setContentType(contentType);
          httpServletResponse.setCharacterEncoding(encoding);
          if (response == null || response.getResponse() == null) {
              httpServletResponse.setContentLength(0);
          } else {
              httpServletResponse.setContentLength(response.getResponse().length);
              httpServletResponse.getOutputStream().write(response.getResponse());
          }
          httpServletResponse.flushBuffer();
      }
docs: 设置请求结果
  
  @param httpServletResponse
  @param response
  @param contentType
  @param encoding
  @throws IOException