From EJB 3.0 and especially in 3.1 EJB Beans, there are more and more POJOs, which is why the EJB concept is eroded in favor of a more general managed Bean concept within CDI. Even the annotation @EJB“competes” with @Injectand can eventually be replaced by it.
Thus, in a CDI, a controller can be a Bean and use Java EE server features such as lifecycle management, etc.
source
share