However, the Jersey tutorial does not say org.w3c.dom.Document can be serialized into xml.
However, this option works fine and return XML output:
Code: Select all
@Produces("application/xml")
public Document postDocument(...){....}
Any comments?
Moderators: Site Manager, fjwalraven
Code: Select all
@Produces("application/xml")
public Document postDocument(...){....}
Code: Select all
From : http://grepcode.com/file/repo1.maven.org/maven2/com.sun.jersey/jersey-core/1.1.4.1/com/sun/jersey/core/impl/provider/entity/DocumentProvider.java
@Produces({"application/xml", "text/xml", "*/*"})
@Consumes({"application/xml", "text/xml", "*/*"})
public final class DocumentProvider extends AbstractMessageReaderWriterProvider<Document> {...}
Code: Select all
1 @Path("1")
2 @POST
3 public StreamSource get1(StreamSource streamSource) {
4 return streamSource;
5 }
6
7 @Path("2")
8 @POST
9 public SAXSource get2(SAXSource saxSource) {
10 return saxSource;
11 }
12
13 @Path("3")
14 @POST
15 public DOMSource get3(DOMSource domSource) {
16 return domSource;
17 }
18
19 @Path("4")
20 @POST
21 public Document get4(Document document) {
22 return document;
23 }
Users browsing this forum: No registered users and 2 guests