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

backing bean constructor is getting called twice. How to initialize it.  RSS feed

 
raju svgk
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a JSF page and a corresponding backing bean class. To initialize the html form fields within the JSF page, I wrote a piece of code to call a sateful session and get the information from the DB. However, while loading the page, backing bean constructor is getting called twice and hence session bean method is also getting called twice.

1) How can we avoid calling the session bean method more than once?
2) Is there any annotation that can be specified for a method, so that it can be called only once while loading the page?
3) I have seen somewhere saying that prerender can be used to make sure that the corresponding method gets called only once. How to specify that? Any example?

Thanks
-raju
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!