I'd like to use tapestry to render things besides HTML files, but I'm
not quite clear on what needs to happen. The biggest non-html thing I'd
like to implement is PDFs via UJAC (which is an XML-to-PDF library that
uses itext). So the idea is that I'd make a Tapestry template which is
then converted into UJAC XML which is then rendered and sent to the
browser.
>From the docs, I can see that I'll need to subclass
org.apache.tapestry.AbstractPage to override the getResponseContentType
to set the content-type.
This one is fairly obvious.
How I set the other http headers isn't quite so obvious to me, but it
there is some mention of doing it with the beginResponse method. I
don't see exactly how that works. Does beginResponse have access to the
servlet request object somewhere that I'm not aware of?
Once I've done that, it looks like I would override one of the methods
that gets called at the end of the rendering cycle to convert the XML
output into PDF output. Same thing: I'm not quite sure how it works.
I would want to render all of the child components, and then render the
result in a completely different way.
Does anyone have any thoughts about how to do this kind of thing?