I'm writing an app for Google App Engine with Java. A certain servlet produces responses that may go over the 32 megabyte limit. On the development server, this does not seem to cause any issues. On the production server, I'll need a way to split the response over several requests.
I want to know what happens on the production server when the limit is exceeded. Does the PrintWriter
throw an IOException
when the limit is exceeded? Or is an exception only thrown when the servlet terminates? Ideally, I would like to be able to calculate the total response size before appending each section (without counting the bytes myself, because I don't know the size of the HTTP headers), so that I can properly clean up the end of the response (i.e. append "}" to complete the JSON object). Or is there a better way to handle this type of situation?