performance - Avoid unnecessary function calls in JSF -


how can avoid calling function on bean more once if have several html elements call function in rendered attribute?

<h:outputtext value="1" rendered="#{mybean.myfunc() eq 70}"/>  <h:outputtext value="2" rendered="#{mybean.myfunc() eq 42}"/> 

here, second outputtext unnecessarily call myfunc() again. possible avoid behavior?

this answer balusc provides nice way set , reuse variables in jsf.


Comments