So I have a servlet, where in response I am writing big chunk of data.
In order to avoid loading entire chunk of data in memory, I read the data in chunk, and "flush" out the stream. (Even if I won't do, servletresponse will flush the buffer if buffer limit is reached).
Now after flushing chunks of data, I ended up getting an error in processing next chunk of data.
How to send error indication to client, as the status has already been sent to client and one set of data has already been set.
After commit, we can't change the status of response, add new headers as per spec.
Any suggestion?