This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
NOTE:if the response was *committed*, but if it is not, just imagine, some default buffer exists in servlet container implementation, then buffer contents just lost.
3. Servlet specification does *not* mandate any default buffer for HttpServletResponse, so if you see on the exam a question about sendRedirect behaviour after you wrote anything to writer - you should select IllegalStateException answer and don't assume that any buffer will handle the situation.
NOTE: JSP *does* have a default buffer which is defined in specification at size 8kb.
4. Tomcat servlet container has a HttpServletResponse implementation with a default buffer, so that's why you don't see exception during sendRedirect test example.
5. To reproduce the *expected* behaviour, just add 'ServletResponse.flushBuffer' before calling 'sendRedirect' You should get an exception in this case as written in java docs.
5.a. As an alternative - you might try 'public void setBufferSize(int size)' before writing to writer.