File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes difference between jsf beans and ejb Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "difference between jsf beans and ejb" Watch "difference between jsf beans and ejb" New topic

difference between jsf beans and ejb

immer alvarado

Joined: Nov 18, 2010
Posts: 9
Hello everyone.

I need some clarification. I know how to work with JSF and its corresponding session beans, but i am getting confused with EJB. What is the difference between the beans introduced with EJB and the session beans used with JSF (for ejb i know about the stateless/full session beans and entity beans, entity manager, etc.). What i just dont get is when to use EJB and when to use jsf beans. Aside from the entity beans, both the ejb stateful/less session beans seem similar to the jsf session beans. I've read about injection ejb's into jsf, but why not just use ejb in conjunction with jsf beans? I hope you can understand my confusion. Thank you.
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33102

Welcome to CodeRanch!

I'm not sure what you mean by "JSF bean". Do you mean ManagedBeans or session beans? If the former, a ManagedBean is a web layer object. It does not provide transaction support and the other benefits of session beans. If the later, they are the same thing. It is common for JSF code to call a stateless session bean. Which is an EJB.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: difference between jsf beans and ejb
It's not a secret anymore!