This content has been marked as final. Show 1 reply
not necessarily. Writer.flush() only flushes anything that might be buffered by that writer; it does not have to flush the actual response.
ServletResponse.flushBuffer() does that. So to properly force flush content to the browser, you would do:
And use \
PrintWriter pw = resp.getWriter(); pw.write("1"); pw.flush(); resp.flushBuffer(); // etc.
tags to format your code. This not only makes it more readable, it prevents the forum from trying to interpret formatting characters.