简体   繁体   中英

ManagedBeans for different components in JSF

I have a question regarding usage of ManagedBeans in application.

I have a page which as different JSP components like autoComplete, selectOneMenu, textarea, inputFields, datatable etc.

I am using separate Service classes and DAO's for these components as Entity classes are different for these.

When it comes to ManagedBeans should I use one ManagedBean for all compoenents for one page or different ManagedBean for different components?

As the components on a single page will most likely be highly coupled, there is no real benefit for using more than one managedbean. However if one part of the bean is highly repeated in several pages you might consider refactoring it into a Composite Component .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM