我查j2EE API的时候关于这两个方法有这段说明Either this method or getWriter() may be called to write the body, not both. 是不是说他们不能同时使用?如果我想又写文本又贴图片那不是两个方法都必须使用,应该怎么办?
还有一句Calling flush() on the ServletOutputStream commits the response.
这句是什么意思啊.什么时候才应该使用flush()
谢谢各位高人解答,小弟不胜感激!
还有一句Calling flush() on the ServletOutputStream commits the response.
这句是什么意思啊.什么时候才应该使用flush()
谢谢各位高人解答,小弟不胜感激!
2.flush() 就是提交response包含的缓冲,如果设为自动commit的话,就不用显示调用了。如果在显示内容比较多是,可以通过调用flush() 让客户端先显示部分信息。
3.flush()之后就不能forward和sendError等操作了,否则也会报异常