code: @Override
      protected void doHeaders(RenderRequest request, RenderResponse response) {
          try {
              doDispatch(request, response);
          } catch (IOException | PortletException ex) {
              logger.error(
                      "Exception rendering headers for portlet "
                              + getPortletName()
                              + ". Aborting doHeaders",
                      ex);
          }
      }
docs: Used by the render method to set the response properties and headers.
  
  <p>The portlet should override this method and set its response header using this method in
  order to ensure that they are set before anything is written to the output stream.
  
  <p>
  
  @param request the render request
  @param response the render response