I have done some reading and playing and I still have some questions I was hoping someone might answer:
So, can I use two or more backing beans in a single JSF page?
<h:intputText value="#{myFirstBean.firstProperty}" />
<h:intputText value="#{mySecondBean.secondProperty}" />
If I can, why should I not do it? (I assume I should not, because nobody does)
If I cannot, why?
Also, I read somewhere something like "on page load the framework would instantiate the backing bean, and populate it if it's a postback". They say the backing bean but I cannot understand how the framework know which backing bean to instantiate.
Let's clarify some terms:
So, yes you can use two or more managed beans in a single JSF page, but splitting UI components bindings, listeners, logic etc. that are related to one page into two or more backing beans is still posible but very undesirable and might cause you lot of problems and bad code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With