File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes JSF bean container Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF bean container" Watch "JSF bean container" New topic
Author

JSF bean container

Kumaravadivel Subramani
Ranch Hand

Joined: Jul 05, 2008
Posts: 166

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.


No pain, No gain.
OCJP 1.6
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15964
    
  19

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
Kumaravadivel Subramani
Ranch Hand

Joined: Jul 05, 2008
Posts: 166

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

Joined: Jun 25, 2001
Posts: 15964
    
  19

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSF bean container
 
Similar Threads
Reference to a component inside a composite component in JSF 2
Help on Jsf 2.0 custom components
Set Managed Bean property (value) without user interaction
Command Link, launch a long proccess
Testing JSF