コード例 #1
0
  @Override
  public void write(Response response, int statusCode, Object body) throws IOException {

    response.setStatus(statusCode);
    response.setContentType(APPLICATION_JSON);
    ObjectMapper objectMapper = new ObjectMapper();
    objectMapper.writeValue(response.getWriter(), body);
  }
コード例 #2
0
  @Override
  public PrintWriter getWriter() throws IOException {

    //        if (isFinished())
    //            throw new IllegalStateException
    //                (/*sm.getString("responseFacade.finished")*/);

    PrintWriter writer = response.getWriter();
    if (isFinished()) response.setSuspended(true);
    return (writer);
  }