@ -1166,8 +1172,9 @@ work. To use the Jackson XML renderer, add the following dependency to your proj
@@ -1166,8 +1172,9 @@ work. To use the Jackson XML renderer, add the following dependency to your proj
</dependency>
----
If Jackson's XML extension is not available, JAXB (provided by default in the JDK) is
used, with the additional requirement of having `MyThing` annotated as
==== JAXB
If Jackson's XML extension is not available, JAXB is tried next,
with the additional requirement of having `MyThing` annotated as
`@XmlRootElement`, as shown in the following example:
@ -1179,9 +1186,15 @@ used, with the additional requirement of having `MyThing` annotated as
@@ -1179,9 +1186,15 @@ used, with the additional requirement of having `MyThing` annotated as
}
----
To get the server to render XML instead of JSON, you might have to send an
`Accept: text/xml` header (or use a browser).
To use JAXB as XML renderer, add the following dependency to your project: