Hi, I write some contents to response out object but did not flush or commit.
Then I get dispatcher and forward it?
OR I use response.sendRedirect?
What are the results?
posted 9 years ago
It depends upon how much content servlet pushed to the response writer (or output stream). The web container will buffer some content and throw that content away if the servlet forwards to a ReqDisp or does a redirect.
However, if the servlet pushed more content than the buffer can hold, then the web container is required to commit that buffer (and the response header) to the browser. After that has happened, any attempt to forward or redirect will fail.