code: protected PrintWriter writer(String contentType, Map headers, int status){
          try{
              RequestContext.setControllerResponse(new NopResponse(contentType, status));
  
              if (headers != null) {
                  for (Object key : headers.keySet()) {
                      if (headers.get(key) != null)
                          RequestContext.getHttpResponse().addHeader(key.toString(), headers.get(key).toString());
                  }
              }
  
              return RequestContext.getHttpResponse().getWriter();
          }catch(Exception e){
              throw new ControllerException(e);
          }
      }
docs: Produces a writer for sending raw data to HTTP clients.
  
  @param contentType content type. If null - will not be set on the response
  @param headers headers. If null - will not be set on the response
  @param status will be sent to browser.
  @return instance of a writer for writing content to HTTP client.