Is it possible to evaluate a JSP only once per session, and cache it after that?

Posted by Bears will eat you on Stack Overflow See other posts from Stack Overflow or by Bears will eat you
Published on 2010-05-07T21:39:16Z Indexed on 2010/05/07 21:48 UTC
Read the original article Hit count: 133

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about jsp

Related posts about servlet