コード例 #1
0
  public static void writeJSON(
      PortletRequest portletRequest, MimeResponse mimeResponse, Object json) throws IOException {

    mimeResponse.setContentType(_getContentType(portletRequest));

    PortletResponseUtil.write(mimeResponse, json.toString());

    mimeResponse.flushBuffer();
  }
コード例 #2
0
  @Override
  public void flushBuffer() throws IOException {
    if (_lifecycle.equals(PortletRequest.RENDER_PHASE)
        || _lifecycle.equals(PortletRequest.RESOURCE_PHASE)) {

      MimeResponse mimeResponse = _getMimeResponse();

      mimeResponse.flushBuffer();
    }
  }
コード例 #3
0
  /**
   * @see {@link ExternalContext#responseFlushBuffer()}
   * @since JSF 2.0
   */
  @Override
  public void responseFlushBuffer() throws IOException {

    if (portletResponse instanceof MimeResponse) {

      if (facesImplementationServletResponse != null) {

        // This happens when Mojarra's JspViewHandlingStrategy#buildView(FacesContext context,
        // UIViewRoot)
        // executes.
        facesImplementationServletResponse.flushBuffer();
      } else {
        MimeResponse mimeResponse = (MimeResponse) portletResponse;
        mimeResponse.flushBuffer();
      }
    } else {

      if (manageIncongruities) {
        incongruityContext.responseFlushBuffer();
      } else {
        throw new IllegalStateException();
      }
    }
  }