Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Manage Bean data to DB during application initialization  RSS feed

 
Qand Davaatsedev
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need to read some configuration data from a JSF managed bean and record it to a database, when a web application starts. Ideally I would like to do it in the listener's contextInitialized() method, however, FacesContext is not available at this point.

Which approach would you recommend?

Thanks.
 
Qand Davaatsedev
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems there is no way to access facesContext during web app initialization.

facesContext is an object of request scope and cannot be accessed from another thread.

I would do it in ServletContextAttributeListener.attributeAdded(), but managed bean are instantiated lazily.

Any thoughts?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!