clear:
As the name implies, the clear method of out object is used to clear the output buffer. This method does not write any contents to the client. An exception is thrown by this method if the buffer was flushed.
General syntax of clear method of out object is as follows:
out.clear();
clearBuffer:
The clearBuffer method of out object is used to clear the output buffer. This method does not write any contents to the client.
The only difference between the clear method of out object and clearBuffer method is
clear method throws an exception when the buffer is flushed.
clearBuffer method does not throw an exception when the buffer is flushed.
General syntax of clearBuffer method of out object is as follows:
out.clearBuffer();
flush:
Two methods of out object, clear and clearBuffer are used to clear the output buffer without writing any contents to the client. If you wish to flush the buffer and write contents to the client, then you can use the flush method of out object. The flush method of out object is used to flush the buffer by writing the contents to the client.
General syntax of flush method of out object is as follows:
As the name implies, the clear method of out object is used to clear the output buffer. This method does not write any contents to the client. An exception is thrown by this method if the buffer was flushed.
General syntax of clear method of out object is as follows:
out.clear();
clearBuffer:
The clearBuffer method of out object is used to clear the output buffer. This method does not write any contents to the client.
The only difference between the clear method of out object and clearBuffer method is
clear method throws an exception when the buffer is flushed.
clearBuffer method does not throw an exception when the buffer is flushed.
General syntax of clearBuffer method of out object is as follows:
out.clearBuffer();
flush:
Two methods of out object, clear and clearBuffer are used to clear the output buffer without writing any contents to the client. If you wish to flush the buffer and write contents to the client, then you can use the flush method of out object. The flush method of out object is used to flush the buffer by writing the contents to the client.
General syntax of flush method of out object is as follows:
out.flush();
参考文章:http://blog.sina.com.cn/s/blog_73cdc7a601018xhx.html
本文详细解释了Out对象的clear、clearBuffer和flush方法的区别及使用场景,帮助开发者更好地掌握Out对象的缓冲区管理。
6263

被折叠的 条评论
为什么被折叠?



