コード例 #1
0
  /**
   * Flush OutputStream or PrintWriter
   *
   * @throws IOException
   */
  @Override
  public void flushBuffer() throws IOException {

    // PrintWriter.flush() does not throw exception
    if (this.printWriter != null) {
      this.printWriter.flush();
    }

    IOException exception1 = null;
    try {
      if (this.gzipOutputStream != null) {
        this.gzipOutputStream.flush();
      }
    } catch (IOException e) {
      exception1 = e;
    }

    IOException exception2 = null;
    try {
      super.flushBuffer();
    } catch (IOException e) {
      exception2 = e;
    }

    if (exception1 != null) throw exception1;
    if (exception2 != null) throw exception2;
  }
コード例 #2
0
  /**
   * {@inheritDoc}
   *
   * @see javax.servlet.ServletResponseWrapper#flushBuffer()
   */
  @Override
  public void flushBuffer() throws IOException {
    if (out != null) {
      out.flush();
      out.close();
      out = null;
    }

    try {
      if (isCommitted()) return;

      if (os != null) {
        // Get the buffered content
        byte[] content = os.getContent();

        // Set content-related headers
        setContentLength(content.length);

        // Write the buffered content to the underlying output stream
        super.getOutputStream().write(content);
      }

      // Flush the underlying buffer
      super.flushBuffer();

    } finally {
      os = null;
    }
  }
コード例 #3
0
ファイル: GZIPFilter.java プロジェクト: jongillies/pwm
 @Override
 public void flushBuffer() throws IOException {
   if (printWriter != null) {
     printWriter.flush();
   }
   if (outputStream != null) {
     outputStream.flush();
   }
   super.flushBuffer();
 }
コード例 #4
0
  /**
   * Flush OutputStream or PrintWriter
   *
   * @throws IOException
   */
  @Override
  public void flushBuffer() throws IOException {

    // PrintWriter.flush() does not throw exception
    if (this.printWriter != null) {
      this.printWriter.flush();
    }

    if (this.gzipOutputStream != null) {
      this.gzipOutputStream.flush();
    }

    // doing this might leads to response already committed exception
    // when the PageInfo has not yet built but the buffer already flushed
    // Happens in Weblogic when a servlet forward to a JSP page and the forward
    // method trigger a flush before it forwarded to the JSP
    // disableFlushBuffer for that purpose is 'true' by default
    if (!disableFlushBuffer) {
      super.flushBuffer();
    }
  }
コード例 #5
0
 /** Flushes buffer and commits response to client. */
 public void flushBuffer() throws IOException {
   flush();
   super.flushBuffer();
 }
コード例 #6
0
ファイル: RackFilter.java プロジェクト: kim/jruby-rack
 @Override
 public void flushBuffer() throws IOException {
   if (!isError()) {
     super.flushBuffer();
   }
 }