Hi, Thanks, yes I've used both these approaches. Assigning a page property is the neater one IMO.
The Tapestry ways are better than defining stuff in the template and creating clutter. John ----- Original Message ----- From: Chris Poulsen To: Tapestry users Sent: Sunday, April 28, 2013 10:43 AM Subject: Re: Tepestry equivalent of a jsp:useBean? Hi, You could get/set the bean instance in a page field before rendering the page. Then you would only perform the expensive get once. Or you could use @Cached for the bean getter. -- Chris On Sun, Apr 28, 2013 at 11:27 AM, John <j...@quivinco.com> wrote: > I'd like to be able to assign a bean to page scope so that the property > getter is not repeatedly invoked. I'm guessing this might not be compatible > with Tapestry practice, but anyway. > > I suppose I could assign a member as a persistent property and then switch > it as required, but I'd like to do something more like this: > > <t:useBean id="bean" t:source="prop:beanGetter"/> > > ${bean.total} > > ${bean.messages} > > Sometimes I prefer to provide properties with a get method that I don't > want repeatedly invoked because of the cost. > > John