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.
You don't have to check every item, you can put <rich:toolbarGroup> in the toolbar, then you can set @rendered on the toolbarGroup instead (or you can have a separate toolbar). Alternatively you can use <ui:include> and instead of changing pages you'd just rerender the content, and the menu would stay the same.