-
1. Re: Response as a custom XML
gavin.king Feb 15, 2008 10:55 PM (in response to yuriy_zubarev)Probably best to just write the XML directly to the response object and then call responseComplete().
-
2. Re: Response as a custom XML
yuriy_zubarev Feb 15, 2008 11:13 PM (in response to yuriy_zubarev)Exactly what I was looking for. Thanks!
-
3. Re: Response as a custom XML
christian.bauer Feb 16, 2008 5:06 PM (in response to yuriy_zubarev)I think a better choice here is to leave the XML header as-is in the outer document, the template.
The whole point seems to be that you want to assemble XML data, right? So the the assembly, the outer document, declares the namespaces etc. Change your blogEntry.content method so that it does not return an XML root element or header. Or add an additional method contentWithoutHeader() that does that.
That seems to be a better long-term strategy, if you consider Facelets to be your XHTML response
assembler
and if you will likely append XML data from different sources into a single document. -
4. Re: Response as a custom XML
ericjung2 Jun 10, 2008 11:13 PM (in response to yuriy_zubarev)You don't need the outer XML element at all:
<h:outputText xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
value="#{xmlObject.xml}" escape="false"/>or even:
<outputText xmlns="http://java.sun.com/jsf/html"
value="#{xmlObject.xml}" escape="false"/>(since the document doesn't need to be XHTML, only XML)