Ejemplo n.º 1
2
  @Override
  public void setResponse(Response response) {
    this.isCommitted = false;
    this.out = null;
    this.response = response = (response != null) ? response : Responses.noContent().build();
    this.mappedThrowable = null;

    if (response instanceof ResponseImpl) {
      final ResponseImpl responseImpl = (ResponseImpl) response;
      setStatusType(responseImpl.getStatusType());
      setHeaders(response.getMetadata());
      setEntity(responseImpl.getEntity(), responseImpl.getEntityType());
    } else {
      setStatus(response.getStatus());
      setHeaders(response.getMetadata());
      setEntity(response.getEntity());
    }
  }
Ejemplo n.º 2
0
 /** Reset the response to 204 (No content) with no headers. */
 public void reset() {
   setResponse(Responses.noContent().build());
 }