File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Buffer the entire Response Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Buffer the entire Response" Watch "Buffer the entire Response" New topic

Buffer the entire Response

Vasim Patel
Ranch Hand

Joined: Apr 29, 2004
Posts: 87

Is there a way in which I can buffer the entire servlet response(headers and content) and send it to the client?
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
I suppose you could use the response method setBufferSize() with some outlandish value. Why?
Peter Bell

Joined: Mar 25, 2003
Posts: 19
You can't send redirects after you've started sending pages. So maybe that's why? But if that was the case, you're still better off figuring out if you need to redirect or not before anything is written to the response.

RimuHosting - JSP and Java Hosting
I agree. Here's the link:
subject: Buffer the entire Response
It's not a secret anymore!