4 Replies Latest reply on Jun 10, 2008 11:13 PM by ericjung2

    Response as a custom XML

    yuriy_zubarev

      Greetings,


      I am trying to figure out how to produce a custom XML output as a response to a request. I guess a short experience with both Seam and Facelets makes it hard for me to see a clear solution.


      Anyway, here is a snippet from pages.xml:


        <page view-id="/authenticate_remote.xhtml" login-required="false" action="#{authenticator.remote}">
          <param name="loginName" value="#{identity.username}" />
          <param name="password" value="#{identity.password}" />
        </page>
      



      'authenticator.remote' receives a request, processes it and generates XML (as a string) that needs to be send back as a response. How do I achieve it? Can I do it directly in a 'remote' method? Right now I have 'authenticate_remote.xhtml'


      <xml xmlns="http://www.w3.org/1999/xhtml"
           xmlns:h="http://java.sun.com/jsf/html">
        <h:outputText value="#{xmlObject.xml}" escape="false"/>
      </xml>
      



      #{xmlObject.xml} outputs the custom xml but it's already wrapped inside 'xml' tag as Facelets require XML structure.


      Thank you.