Java – the difference between JSF beans and EJB beans

I need some clarification I know how to use JSF and its corresponding session beans, but I'm confused about EJB What is the difference between the bean introduced by EJB and the session bean used with JSF (for EJB, I know stateless / session bean and entity bean, entity manager, etc.) What? I don't know when to use EJBs and when to use JSF beans In addition to entity beans, EJB state / session beans seem to be similar to JSF session beans I've read JSF about injecting EJBs, but why not combine EJBs with JSF beans? I hope you can understand my confusion thank you.

Solution

Different types of managed beans in Java EE do have some confusion To add confusion, Java EE 6 introduces a third managed bean: CDI bean

In this answer, I try to explain the differences and similarities: how do CDI and EJB compare? interact?

In short, JSF managed beans mainly do not provide transaction support, which is often needed when dealing with business logic, especially JPA

It should also be noted that the term session managed bean in the session scope is completely different from the term referred to by stateless and stateful session beans

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>