JSF managed bean question

Posted by Nitesh Panchal on Stack Overflow See other posts from Stack Overflow or by Nitesh Panchal
Published on 2010-05-05T10:49:56Z Indexed on 2010/05/05 15:28 UTC
Read the original article Hit count: 145

Filed under:
|

Hello,

I have one page which uses <ui:insert> called master.xhtml which uses one managedbean named MasterBean.java and its of viewScoped. It calls webservice and has all useful data which will be useful in master.xhtml as well as page which is built using master.xhtml (which uses <ui:include>). When i visit data.xhtml (which uses template as master.xhtml) and which uses managed bean as DataBean.java which is also of view scoped, how do i use MasterBean? If i directly use #{Masterbean.property}, won't it create a new instance again? or will it use the bean which is already in view scope? Also how do i use MasterBean in DataBean in such a way that existing MasterBean's instance is used in DataBean. I don't want new instance of MasterBean in DataBean.

Thanks in advance. If i am not clear please let me know.

© Stack Overflow or respective owner

Related posts about jsf

Related posts about facelets