Thiago H. de Paula Figueiredo wrote:
> On Mon, May 18, 2009 at 10:57 AM, Andy Buckley
> <andy.buck...@durham.ac.uk> wrote:
>> Thanks for the advice. I'd rather avoid using separate pages, as
>> mentioned, but including the format handling in the activation context
>> is certainly possible. It prompts another question, though: how do I
>> return the "normal" page rendering as a StreamResponse in onActivate?
> 
> Return null.
> 
>> That "return null" is obviously wrong: I was hoping that it would fall
>> back to the default page rendering via the template but it just causes a
>> NullPointerException.
> 
> Please post the stack trace, as returning null is the way to do what you want.

Thanks for the help and rapid response; much appreciated! Prodding me to
take a proper look at the stack trace was just what was needed: the
NullPointerException was in my testing for the "format" param rather
than in Tapestry's handling of the null return!

So I now have a working multi-format onActivate(). Cool! One last
question, how to link to these alternative formats? I've tried a
PageLink in View.tml:

<a href="#" t:type="pagelink" t:page="view" t:context="literal:xml">XML</a>

but as mentioned elsewhere in the thread, this generates a URI without
the parent page's context (which magically still works), i.e. the URI
generated by the above is
.../view/xml
rather than the hoped-for
.../view/p1234/xml

Can you help with this last piece of the jigsaw? ;) Thanks yet again;
I've learned a lot about Tapestry thanks to your (pl) helpful replies.

Andy

-- 
Dr Andy Buckley
Institute for Particle Physics Phenomenology
Durham University
0191 3343798 | 0191 3732613 | www.insectnation.org

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

Reply via email to