This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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.
Don't get me started about those stupid light bulbs.
subject: Menus caching in struts 2
Similar Threads
need solution on struts tiles
How to use Actions inside Javascript menus???
Discussion on the various classes needed for an Application --- Anyone?
Vertucal Menu bar based on database values
How to pre populate a drop down