This content has been marked as final. Show 9 replies
debdutta wrote:Why do you want to avoid it? If your getters merely return a value as they should then you won't need to change anything.
In my application i can see getter is calling more than once. I know this is due to JSF life cycle, but can i avoid that?
what will happen if i use immediate ="true"You do have some documentation with you as you are developing to check on such things, right?
actually why i want to avoid it becauase, in my getter what value i am getting that is from a xml node, and there is some code in getter which each time executing , i know its not standard to put any code in getter..but i have to do so becasue each variable is taking from a buffer position i can't change this logic / its not possible as per my project stucture .
So i just want to stop multiple time getter execution ...
debdutta wrote:I'm not yet convinced of this.
...but i have to do so becasue each variable is taking from a buffer position i can't change this logic / its not possible as per my project stucture .
Is your bean using request scope?
Why not get the value in a method (say init) called by the constructor of the bean?
If you need fresh data on the page you can invoke that init method each time.
My bean is in session scope.
I can't use one single init, because suppose i want to work with a variable , so only that value have to get from buffer, i can't call whole init in this case, so its requirement basic, why i have use that in getter means when ever that variable is refered , i can get the correct value from that buffer as i am not directly assigning value directly to that variable insatde of i am updating the buffer.
Actually this architecture i have used because this is a conversion project and this we have done to handle multiple redifination of the source language where suppose for example
0 to 5 position means variable A
0 to 8 means variable B
3 to 12 means variable C
nyway that is reason to use logic in getter and we have to stricked on that...
And my question is I am trying to find a solution to stop multiple time getter execution on a single request , [like page load or sometimes ajax based - only pertial part of pages will be rerender] ..so it is possible any way ..
"ejp" can i expect any solution if anyother people has faced same problem on this or it might never come...lets see