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(); %> |