JSF backing bean structure (best practices)

后端 未结 6 795
谎友^
谎友^ 2020-11-28 00:21

I hope that in this post, I can get people\'s opinions on best practices for the interface between JSF pages and backing beans.

One thing that I never can settle on

6条回答
  •  天涯浪人
    2020-11-28 00:55

    I would not necessary keep only one backing bean per page. It depends on functionality but most of the time I had one bean per page as mostly one page handle one functionality. For example on a page I have a register link (I will link with RegisterBean) and a shopping basket link (ShoopingBasketBean).

    I do use this <:outputText value="#{myBean.anObject.anObjectProperty}" /> as I normally keep backing beans as action beans which holds data object. I don't want to write a wrapper in my backing bean to access the properties of my data objects.

提交回复
热议问题