This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes EJB and other Java EE Technologies and the fly likes EJB3 + JSF2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB3 + JSF2" Watch "EJB3 + JSF2" New topic
Author

EJB3 + JSF2

eve agostini
Ranch Hand

Joined: Nov 01, 2005
Posts: 43
Hi all!
I'm getting in touch with EJB3 and trying to figure out if it makes sense to use it with JSF and which is the best way to do it.
I'm new to EJB while I've been using JSF for a while (JsSF 2 now).

In particular I'm getting a little confused about the integration of JSF managed beans and EJB session beans. I know that I can inject an EJB session bean in a JSF managed bean; but it's also true that I actually could invoke EJB session bean's method directly from an xhtml page and just bypass managed beans. I mean, which is the best way to share responsibilities among them?

Also, I got a little confused about scopes. I set up a little app with a managed bean and a stateless session bean. I though that the stateless session bean was supposed not to maintain state but it does (a member variable value is kept among different invocations). And this is true both in case the managed bean has request scope and in case it has session scope. Is it just a coincidence? I mean, because of the fact that the container is responsible for creating and destroying beans so I cannot be sure that the stateless bean is actually reinitialized at each request?

Thanks for any help

Eve
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: EJB3 + JSF2