闁衡偓閹増顥� (0) +1 閻犙嶆嫹 (0) +1 闂婎亷鎷� (0) +1
闁衡偓閹増顥戦柟瀛樺姇婵拷闁哄被鍎冲﹢鍛村绩閹増顥�>>

正在阅读:JSP中捕获 OUT 输出的例子JSP中捕获 OUT 输出的例子

2004-09-03 14:49 出处:CSDN 作者:liboy 责任编辑:linjixiong


  public void clearBuffer() {
  os.reset();
  }

  public ServletOutputStream getOutputStream()
  throws java.io.IOException
  {
  return response.getOutputStream();
  }

  //执行该方法可以将内容输出,或者保存为文件
  public final void close()
  throws IOException
  {
  System.out.println( "以下为静态输出" );
  System.out.println( os.toString() );
  }

  public final int getBufferSize()
  {
  if(bufferSize == 0)
  return bufferSize;
  else
  return response.getBufferSize();
  }

  public final int getRemaining()
  {
  return os.size();
  }

  public final boolean isAutoFlush()
  {
  return autoFlush;
  }
  }

  %>

  <%

  out = new MyOut();

  out.println( "开始输出, 在浏览器将会什么都不到<BR>" );
  %>

  <html>
  <head>
  <body>

  <%
  out.println( "文件内容" );
  %>

  </body>
  </head>
  </html>
  <%
  out.close();
  %>


  


察看评论详细内容 我要发表评论
作者笔名 简短内容 发表时间
:
键盘也能翻页,试试“← →”键

关注我们

最新资讯离线随时看 聊天吐槽赢奖品
闁归潧顑嗗┃鈧悹浣告健濡拷闁搞儳鍋涢崺灞俱亜閸洖鍔�