mercredi 4 mars 2015

How to return indented XML using Spring mvc:annotation-driven and ResponseBody

I've implemented a simple controller that returns a converted XML object using JAXB and @ResponseBody annotation.


My problem is I'm having a hard time to configure the default converter created by mvc:annotation-driven, and I needed to configure it to render my XML indented. I know I can declare my view resolvers, but I wanted to keep using annotation-driven.


I've searched and found that I could configure mvc:annotation-driven through the usage of mvc:message-converters, but I'm having a lot of trouble finding good documentation to configure Jaxb2RootElementHttpMessageConverter.


Aucun commentaire:

Enregistrer un commentaire