https://bz.apache.org/bugzilla/show_bug.cgi?id=61275

--- Comment #17 from Carl Buxbaum <[email protected]> ---
(In reply to Dominik Stadler from comment #16)
> The latest "repaired Results_bad.xlsx" opens for me in Excel without any
> corruption warning, so I don't see what we can do here from our end. 
> 
> If you still think there is a problem in POI please try to provide a more
> self-sufficient and minimal unit test which produces the corrupt file. The
> current code is intertwined with Apache Struts code and other things that
> are not related to the problem at all.

Hi Dominik et. al.,

I did finally discover what was causing this.  Essentially doing a redirect
instead of a forward fixes it in our struts application:

The jsp uses JSPWriter to create the jsp page, and the struts action uses the
OutputStream from the response to stream the excel. It is not permissible for
both to be used in the same request, and the error generated results in a
message being appended to the OutputStream( and therefore to the excel
spreadsheet, corrupting it). Therefore, the fix is to do a redirect to the
struts action, which creates a new request that only handles the response
OutputStream, instead of forwarding to the struts action, which handles the
streaming of the excel in the same request as the jsp. I don't know why this
only manifests in WebSphere, and Tomcat seems to not have this issue.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to