Affects Version/s: 2.5
Fix Version/s: 2.5.5
We recently upgraded from struts 2.3.x to 2.5.2 at our workplace. One of the changes we noticed was with stream result - if an error occurs, the output stream is automatically closed and no response is sent to the user (ignoring our custom error-500 page). The content-length of the response is thus 0 - a blank page.
This is occuring due to the addition of try-with-resources. In 2.3.x, the output stream wasn't set until after we find the input stream, like so:
However, in 2.5, this was changed to use a try-with-resources on the output stream by ticket
So, when we throw an error, the stream is closed and nothing further is written.
Is this intended behaviour? Is there an alternate solution to show our own error pages now (with stack trace?)?