On Mon, 15 Nov 2010 12:39:29 -0200, nille hammer <tapestry.nilleham...@winfonet.eu> wrote:

Hello Niksa,

In my application I need to receive XML requests, and then to send the
response back to the client in XML format too. I tried to find some nice
solution here, but with no success. I hope you can give me some short code examples.

As far as I understand this is not supported out of the box by Tapestry. Tapestry is designed to recieve Requests for web pages and render HTML-Responses.

In my humble opinion, what you've written is not 100% correct. You can use a Tapestry template to generate any kind of XML, not just HTML. Tapestry templates are valid XML! Just use @ContentType("text/xml") in your page class (see http://tapestry.apache.org/tapestry5.1/apidocs/org/apache/tapestry5/annotations/ContentType.html). Tapestry can also return XML very easily by returning a TextStreamResponse for scenarios at which XML is generated elsewhere (XSLT, some XML-specific package).

For generating Responses: The quickest approach would be a Templating engine like Freemarker or Velocity or even Tapestry's own extension. Integration of those is performed e.g. by Chenillekit, infos here: http://www.chenillekit.org/chenillekit-template/index.html

These templating engines are not specific to XML, so I recommend using Tapestry templates or some XML package instead of using a generic templating engine.

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to