首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

response.reset()跟response.resetBuffer()

2012-10-07 
response.reset()和response.resetBuffer()getResponse的getWriter()方法连续两次输出流到页面的时候,第二

response.reset()和response.resetBuffer()

getResponse的getWriter()方法

连续两次输出流到页面的时候,第二次的流会包括第一次的流,所以可以使用将response.reset或者resetBuffer的方法。

?

reset():
Clears any data that exists in the buffer as well as the status code and headers. If the response has been committed, this method throws an IllegalStateException.

resetBuffer():
Clears the content of the underlying buffer in the response without clearing headers or status code. If the response has been committed, this method throws an IllegalStateException.

?

?

response.reset()的使用有一个条件受限:response的任何打开流关闭之后都不能再reset?.

热点排行