1 Reply Latest reply on Apr 23, 2015 6:43 AM by Michal Petrov

    Is it possible to cache a complete rich:toolbar for next access?

    Edilmar Alves Expert



      I have an webapp with a menu.xhtml that uses a rich:toolbar + many rich:menuItems to access many other JSF pages.


      First the user types login/password in a login.xhtml and then he goes to menu.xhtml.

      At this moment, I check the user rights for all menuItems, and I use rendered="..." at each menuItem to display or not this option.


      I also created a TreeMap to save in session scope the user rights, because when the user selects a menuItem and change to the

      next page, I again put the rich:toolbar + rich:menuItems in the top the page before the normal page components.

      I use a file templateMenu.xhtml that is used in all internal pages of the webapp.


      PROBLEM: For each new page loaded, JSF has to reprocess the rich:toolbar and check user rights for all rich:menuItems.

      My TreeMap "cache" helps to reprocess fastly in the server, but the server always has to send this "repeated" part to client,

      and client browser has to render too.


      I would like to know a way, it it is possible, to save all the rich:toolbar in some place, like session scope and just send this cache toolbar to the client.