XML is a standard way to process data in the client/server architecture. Jersey provides different ways to use XML for data traversing over the client/server.
Low-level XML support consists of:
StreamSource
SAXSource
DOMSource
Document
Let's look at the following example:
Server side:
@Path("/userResource") public class UserResource { @POST @Path("usingStreamSource") public StreamSource getStreamSource(StreamSource streamSource) { return streamSource; } @POST @Path("usingSAXSource") public SAXSource getSAXSource(SAXSource saxSource) { return saxSource; } @POST @Path("usingDOMSource") public DOMSource getDOMSource(DOMSource domSource) { return domSource; } @POST @Path("usingDocument") public Document getDocument(Document document) { return document; } }
StreamSource, SAXSource, DOMSource, and Document are different types of XML formats. These low-level formats are used to read...