3 Replies Latest reply on Jun 17, 2010 9:49 AM by mow.spackenwasser.gmx.de

    controller methods called multiple times

    mow.spackenwasser.gmx.de

      Hi,


      im pretty new to seam/JSF but i already run into a potential performance problem with my code.
      i have multiple links which shall be rendered depending on the users roles etc:


      Controller:



      public boolean allowViewHistory() {
                return securityManager.isPersonAuthorized(...);//this call may be expensive
           }



      View:



      <s:link view="/history.xhtml" rendered="#{oucontrol.allowViewHistory()}">...




      Debugging shows that the method is called 5 times per Page request, while the method is only referenced once on the JSF. How can i effectivly prevent this without caching the results in the controller? i have a lot of such small but potential expensive controller methods..