Daniel Fagerstrom pisze:
Grzegorz Kossakowski skrev:
Daniel Fagerstrom pisze:

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?

I don't see any possibility to do this in the pipeline. My idea was to do the mime type setting (on the http response object) in the endDocument method of the ServletServiceSerializer. It could be done after the:

IOUtils.copy(new StringReader(serializedXML), servletSource.getOutputStream());

but before:

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

The http response object is available from the object model.

I understand your intention. I was asking what we should do with the checking above? Surely, I can remove throwing exception but this way we lose check if mime type was set. I was asking if we can move it somewhere else.

If not, do you feel that removing that check is a good idea?

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

Reply via email to