Hi there,
This is a real newbie question so my apologies upfront for any major misunderstandings. What is sendError(int) doing from setStatus(int) that makes it different ?
My understanding is that setStatus simply sets the error code on the response object and then web server will return some default message/page that is simply displayed by the client. right ?
Regarding sendError(int), am I to understand that it sets the status code but in addition to that, sets up the content body and hence potentially throws an IOException ? What is in this content body that we are not specifying and where does it come from ?
Also, on a related note, why does the buffer need to get flushed when sendError(int) is called ?
Many thanks for your answers !
Alex