My site has a nav menu that is dynamically built as a separate JSP, and included in most pages via <jsp:include />
. The contents and styling of the menu are determined by which pages the user does and doesn't have access to.
The set of accessible pages is retrieved from the database when a user logs in, and not during the course of a session. So, there's really no need to re-evaluate the nav menu code every time the user requests a page. Is there an easy way to generate the markup from the JSP only once per session, and cache/reuse it during the session?