Grzegorz Kossakowski skrev:
Daniel Fagerstrom napisaƂ(a):
I should obviously think before writing ;) Anyway in the endDocument() method one could get the mime type from the servlet source *after* the above IOUtils.copy call, then continue to call the setContentType in the response object of the caller and after that call

IOUtils.copy(servletSource.getInputStream(), super.output);

This could work but it's hackiest hack I would say ;)

Daniel, do you really think it's the best solution? I fear that it's hacking nature will bite us in near future but it's just a gut feeling...

The current architecture is based on the assumption that the creation of the response header must be completely finished before the creation of the response body starts. I.e. that response header creation must be done in the setup rather than in the pipeline execution. I think (but haven't checked all possible consequences) that this is an unnecessarily restrictive assumption. AFAICS it would be enough to require that the creation (and output) of the response header is finished before the response body starts to be emitted.

With such a less restrictive assumption, it would be OK to set response headers as I suggested above.

/Daniel

Reply via email to