dcsimg
backing bean constructor is getting called twice. How to initialize it.
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   SVGK_Raju
Posted On:   Thursday, November 16, 2006 05:43 AM

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    More>>

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

   <<Less
About | Sitemap | Contact