The "watch" parameter will reset the cache if another property changes.
Consider a loop:
${transformedItem.someProperty}
public class MyPage
@Property
private Item item;
public List getItems() { ... }
@Cached(watch="item")
public TransformedItem getTransformedItem
thanks, that could do the job - but is there any example of using the watch
parameter?
- Original Message -
From: Lance Java
To: users@tapestry.apache.org
Sent: Monday, December 31, 2012 8:49 AM
Subject: Re: implementing a Tapestry IoC annotation to cache method results
Are you aware of the @Cached annotation? When used on a component/page
method, only the first invocation will invoke the method. Subsequent calls
will use a cached value.
http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/annotations/Cached.html
http://tapestry.apache.org/tapestry5/