tags:

views:

67

answers:

1

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.

+2  A: 

It will use the bean that is already instantiated in request scope.

Bozho
Kudos for figuring the actual question/problem in the mush btw :)
BalusC
Hi Bozho, so how do i make use of masterbean in dataBean ?do i need to inject it? or create a new instance using Masterbean b = new Masterbean()?
Ankit Rathod
yes, inject it.
Bozho