Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

EJB3 + JSF2

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Oh, sure, you could do that. Or you could eat some pie. While reading this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic