Backing beans (@ManagedBean) or CDI Beans (@Named)?

后端 未结 5 1868
南旧
南旧 2020-11-22 00:33

I\'ve just started reading through Core JavaServer Faces, 3rd Ed. and they say this (emphasis mine):

It is a historical accident that there are two se

5条回答
  •  眼角桃花
    2020-11-22 00:47

    CDI is preferred over plain JSF because CDI allows for JavaEE-wide dependency injection. You can also inject POJOs and let them be managed. With JSF you can only inject a subset of what you can with CDI.

提交回复
热议问题