I'm writing a simple project using Spring MVC. I have a Controller with a handler method annotated with @ResponseBody that returns a javax.xml.transform.Source. In my handler method, I return a org.apache.axiom.om.impl.jaxp.OMSource object. OMSource extends javax.xml.transform.sax.SAXSource. After I return this result, I see org.springframework.http.converter.xml.SourceHttpM essageConverter check to see if it supports my result (all as expected so far). However, SourceHttpMessageConverter checks whether it can support the result by checking to see if the concrete class is one of DOMSource, SAXSource, StreamSource, or Source. Its checks look like:
This fails since my result's concrete class is not one of these, though my result's class does extend one of these (SAXSource). Should SourceHttpMessageConverter work with subclasses of the types mentioned above?Code:return DOMSource.class.equals(clazz) || SAXSource.class.equals(clazz) || StreamSource.class.equals(clazz) || Source.class.equals(clazz);
Thanks very much in advance!


Reply With Quote
