Meaningless Drivel is fun!*
The moose likes JSF and the fly likes JSF - property get method gets called many times Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF - property get method gets called many times" Watch "JSF - property get method gets called many times" New topic
Author

JSF - property get method gets called many times

Bert Bertens
Greenhorn

Joined: Feb 16, 2010
Posts: 14
This thread is about the JSF caching problem: http://seamframework.org/Documentation/WhyDoesJSFCallMyGetterHundredsOfTimes

I have a <h:dataTable> which calls bean.getList, which creates a query to the database and returns some objects. I obviously don't want this method to be accessed so many times.

I wonder if anyone has a good solution to solve this problem?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Don't get the list from the database in your bean every time. Get it somewhere else and expose it via the getter, or cache the results the first time the getter is called.

Which is kind of what it says in the link you provided, no? And the comparison of caching techniques linked to on the same page discusses other options in more detail.

What other kind of information are you looking for?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Moved to JSF forum.
Bert Bertens
Greenhorn

Joined: Feb 16, 2010
Posts: 14
thanks! I totally looked over that link, think I'm gonna go with the interceptor way.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSF - property get method gets called many times