About Question com.enthuware.ets.scwcd.v5.2.5 :
Posted: Mon Oct 27, 2014 9:16 pm
The explanation says it will not throw an exception because "As per the API of the sendError() method, if you write to the response after calling sendError() then the data is ignored and no exception is thrown."
Below is the quote from the API. It does not directly agrees with the above, and to me it throws doubt if we would not get an IllegalStateException writing to the resource after the sendError().
Can someone comment on this. In practical (exam!) terms, should one consider that an out.println() of some data after the sendError will throw an exception, if the buffer has been large enough to have so far avoided a commit?
API:
http://docs.oracle.com/javaee/5/api/jav ... ng.String)
Below is the quote from the API. It does not directly agrees with the above, and to me it throws doubt if we would not get an IllegalStateException writing to the resource after the sendError().
Can someone comment on this. In practical (exam!) terms, should one consider that an out.println() of some data after the sendError will throw an exception, if the buffer has been large enough to have so far avoided a commit?
API:
**If the response has already been committed, this method throws an IllegalStateException. After using this method, the response should be considered to be committed and should not be written to.
http://docs.oracle.com/javaee/5/api/jav ... ng.String)