Re: Cache some information while server startup
Tuesday, January 8, 2008 06:01 PM
Before answering your question, some background: A JSF based applicaion still have servlets and JSP at the back of it. If you are familiar with doing this with ordinary JSP/Servlet based application, you do the same with JSF based application.
Simplest solution would be do define a servlet which loads at server startup(there is a setting in web.xml to load a servlet at startup) and in its init() method intialize a bean with the data you want to cache and put that bean in application context.
Later you can use this application scoped bean in your JSF managed beans, in normal way you would access any application scoped bean.
Hope this helps