File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Menus caching in struts 2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Menus caching in struts 2" Watch "Menus caching in struts 2" New topic

Menus caching in struts 2

Abhilash Chander
Ranch Hand

Joined: Oct 18, 2009
Posts: 39
Hi, I'm developing a website in struts 2. I have horizontal menus at the top and they are displayed on every page. So evertime a user goes to a new page, the menus are fetched from the database. I dont want my applicaton to fetch menus from database for each request. Is there a way to cache my menus somewhere, so i can save time of fetching them from the database. Thanks in advacne
David Newton

Joined: Sep 29, 2008
Posts: 12617

Lots of options. You could keep the menus in the application context. If they're user-specific they could be in the session context. You could cache in the DB layer.
I agree. Here's the link:
subject: Menus caching in struts 2
It's not a secret anymore!