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?
Was looking for this and thought I'd share the code equivalent
@Bean
public Marshaller jaxbMarshaller() {
Map props = new HashMap();
props.put(javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
Jaxb2Marshaller m = new Jaxb2Marshaller();
m.setMarshallerProperties(props);
m.setPackagesToScan("com.example.xml");
return m;
}