I'm trying to find a pattern that could solve my problem.
I need to populate some dropdowns in the web page with items that are stored in the db. I'm getting the itmes using CMPs and then through session bean method.
How can I cache this information. The items from dropdowns are need for all users but only one user can change them (admin).
Do you know a such pattern ? Witch is the best way to transfer the information from business layer to web layer for this situation ?
Cache the drop down data in a Collection or Map, which you store in the ServletContext (which is global for all users).
Initialize this data in the init() method of an InitServlet, and specify that this servlet is loaded on your application startup (<load-on-startup> value in your web.xml file).
Provide admin servlets and JSP that allows you to refresh/update this list.
Thanks a lot.