Jim So wrote:I recall a question in the HeadFirstServlets+Jsp's book... i found it Chapter 5, Q1.
The answer states that if you cann os.write() or os.flush(), then the response is sent back to the client. Therefore if you try and attempt a forward, you will get an IllegalState exception.
Is this true? That both os.write() and os.flush() will cause this?
Forwarding the response is what actually causes the IllegalStateException because your attempting to forward it after the you have flushed.
But its flush() which triggers it.
I find that question a little ambiguous!