This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes JSF and the fly likes Bean from Bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Bean from Bean" Watch "Bean from Bean" New topic

Bean from Bean

francisco roman
Ranch Hand

Joined: Jun 22, 2005
Posts: 31
Hi guys,
In your opinion, doesn it make sense to populate a backing bean from another backing bean? And if it does, how would you do it?

Rick Beaver
Ranch Hand

Joined: Dec 14, 2004
Posts: 464
I have done something like this using Session scoped beans (not sure about application scoped beans)

You can access an existing Session scoped bean by using Session.getAttribute(String attribute) where the argument is the EL name in faces-config.xml.

That is the method I use for accessing Session scoped backing beans from other code.

ph34r my 133t j4v4 h4><0r1ng sk177z
francisco roman
Ranch Hand

Joined: Jun 22, 2005
Posts: 31
is Session available in a generic backing bean? so it seems from
your message.
It is sorta covered in the JavaRanch Style Guide.
subject: Bean from Bean