• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSF bean container

 
Ranch Hand
Posts: 171
Spring Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I'm a newbie for JSF and very much interested to know about the JSF internal processing. By the way I've a doubt about the JSF bean container, Is it uses any internal container or EJB's one?
Since JSF able to process managed bean it should be any container to process beans. I just searched for it and not able to find the exact answer and seen somewhere Inversion of control like that.

Kindly help me on this. Thanks in advance.
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jsf doesn't actually have a bean container. JSF's backing beans are simply standard J2EE beans. So a JSF request-scope object is part of the HttpServletRequest attributes collection, a session-scope object is part of the HttpSession attributes, and an application-scope managed bean is stored as an application attribute. These objects are equally accessible via both traditional Java code and JSF, which makes it easy to pass stuff back and forth, for example, when a JSF view initiates the generation of a PDF from a PDF-generating servlet, the JSF can store generation info in a session bean which the generating servlet can then consume.

The only real difference between JSF Managed Beans and traditional J2EE beans is that Managed Beans are defined with the information necessary for JSF to construct and wire together the beans itself instead of making you write your own code to do it. That's part of the Inversion of Control paradigm, and if you're not familiar with IoC, please do read up on it. It's not just a part of JSF - it's a general technique for promoting code reuse and flexibility. For example he Spring Framework is a system that can be used in a variety of environments to do IoC bean construction and cross-connection.
 
Kumaravadivel Subramani
Ranch Hand
Posts: 171
Spring Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Tim, really that was a awesome response and I've another question to ask you.

"Inversion of Control usually refers to the "containers" while Dependency Injection refers to the actual pattern"???
 
Tim Holloway
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Kumaravadivel Subramani wrote:
"Inversion of Control usually refers to the "containers" while Dependency Injection refers to the actual pattern"???



I don't know if IoC qualifies as a true pattern, anymore than MVC does. However, IoC is the name of the strategy and Dependency Injection is one of its primary functions.

For any definitions more precise than that, you're best off consulting the academicians.
 
reply
    Bookmark Topic Watch Topic
  • New Topic