I have following represent method
@Override
public Representation represent(Variant variant) throws
ResourceException {
DomRepresentation representation = new
DomRepresentation(MediaType.TEXT_XML);
Document document = representation.getDocument();
DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
ByteArrayInputStream bai = new
ByteArrayInputStream(xmlStr.getBytes());
document = builder.parse((InputStream)bai);
document.normalizeDocument();
return representation ;
}
FOllowing are other methods from this same Resource class
@Override
public void init(Context context, Request request, Response response){
if(log.isDebugEnabled())
log.debug("Inside init");
super.init(context, request, response);
getVariants().add(new Variant(MediaType.TEXT_XML));
}
@Override
public boolean allowPost() {
return true;
}
@Override
public boolean allowGet() {
return true;
}
note document is getting created propertly and stuff (confirmed from
debugging). I also verified converting Document back to XmlString and that
also works fine but "representation" doesn't print anything on the page when
I call this service. Any idea what's missing in here?
--
View this message in context:
http://n2.nabble.com/DomRepresentation-doesn-t-print-xml-on-screen-tp4670498p4670498.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2454614