Do we commit output by out.println()? When the response (or part of it) is flushed to the client, then we say that the output is committed. Refer to the "autoflush" attribute.
This can happen in more than one ways. One, the flush() method is called on the out obj. Secondly, when the buffer is full (and the autoflush is true, which is the default) the server flushes the drain...errr...output to the client.
If i am using forward, what is the use of using out.println(); It gives no output and also no error if used. just forwards to the called servlet no matter where u put the out.println statement. That is the intended behavior. Read your
other post. This uses the flush() on the out obj and look for the
IllegalStateException in your catalina logs.
Axel and I had a discussion on this.
2)How can i check the output data in the response buffer.
By using response.isCommitted() and finding if it is true or false. I haven't tried this though.
But where shall i put the out.println code?? to verity the specs Again the link abv used the out.println() and the out.flush() methods to verify the IllegalStateException, if flushed before the forward() method. Also, out.println() method calls after the forward will be ignored. You shouldn't see them on the client.
regds.
- satya