| Author |
Getter called too many times
|
Vadim Vararu
Ranch Hand
Joined: Jan 03, 2009
Posts: 147
|
|
I have a getter method:
I'm debugging the moment when this page loads and i don't know why getDataList method is called more than 10 times.... I can't understand where it is called from. I don't have this method call in other places in the page.
|
If you think you've done too much, usually it means you've done too few.
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14491
|
|
Well, your first mistake is in using JSTL on a JSF view. That almost always means you're not using JSF effectively, and in many cases, you can actually interfere with the proper operation of JSF.
Your second mistake was in not understanding the JSF lifecycle. It's quite normal for getters to get called multiple times on a view request. The main concern there is that the getter be exactly that: a method to get a value. If you try and throw additional logic into the get method, you'll see unfortunate side-effects.
|
Customer surveys are for companies who didn't pay proper attention to begin with.
|
 |
Vadim Vararu
Ranch Hand
Joined: Jan 03, 2009
Posts: 147
|
|
|
Ok, i know that during the lifecycle it calls getter more than one time, but not more than 10 times...
|
 |
 |
|
|
subject: Getter called too many times
|
|
|