Daniel Fagerstrom pisze:
Grzegorz Kossakowski skrev:

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.

I wonder how to achieve this less restrictive assumption. In 
AbstractProcessingPipeline#setMimeTypeForSerializer() there is:
if (mimeType != null) {
  environment.setContentType (mimeType);
} else {
  // No mimeType available
  String message = "Unable to determine MIME type for " +
    environment.getURIPrefix() + "/" + environment.getURI();
  throw new ProcessingException(message);
}

We have to move this checking somewhere further in the processing but I have no 
good idea where exactly. Ideas?

--
Grzegorz Kossakowski
http://reflectingonthevicissitudes.wordpress.com/

Reply via email to