I am using Jaxb2Marshaller as a view property for ContentNegotiatingViewResolver. I am able to get the xml repsonse. How do I format (pretty print) it?
Use jaxb.formatted.output instead of javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT as
Map map = new HashMap(); map.put("jaxb.formatted.output", true); jaxb2Marshaller.setMarshallerProperties(map);