For all you \"duplicate\" fanatics, there is a similar question on SO right here. The difference is that I paint a vivid example that I can not understand the output of.
The explanation is in your own question:
JspWriter uses a PrintWriter behind the scene, but since by default JSP pages are buffered, the PrintWriter won't be created until the buffer is flushed
This means that what is written to the JspWriter is buffered, and once this buffer is flushed (either because the buffer is full, or because the JSP has reached the end of its execution), the contents is written to the response's PrintWriter.
So the flow of your example is the following one:
JSPs should use the JspWriter denoted by the “out” implicit object for sending output back to the client. A JspWriter is a buffered version of the PrintWriter. Refer JspWriter API for details. JspWriter also differs from a PrintWriter by throwing java.io.IOException, which a PrintWriter does not.