aspose file tools
The moose likes JSF and the fly likes Access session Bean from another backing Bean Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Access session Bean from another backing Bean" Watch "Access session Bean from another backing Bean" New topic
Author

Access session Bean from another backing Bean

Daniel Breitner
Ranch Hand

Joined: Nov 13, 2008
Posts: 70
Hello everybody,

I have the following issue:

I have a session bean containing some information that I want to access in another backing bean.
So bean2 should somehow have access to bean1.
I thought I could use managed-properties for that but somehow I can“t find out how to do this.

Who can help me ?

with kind regards

daniel


Visit me at http://liferay-blogging.blogspot.com
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14456
    
    7

You are correct. Inject the second bean into the first bean:


This bean has 2 other beans injected into it - categoryService and categoryKeyService. So in addition to the faces-config info, there are public setter methods which I've given the same names as the injected beans. Like so:

public void setCategoryService( CategoryServiceBean injectedbean) {
this.categoryService = injectedbean;
}


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: jrebel
 
subject: Access session Bean from another backing Bean
 
Similar Threads
Doubt about transaction context in statefull session Bean
scopes
How can we use <jsp:scriptlet /> tag in jspx file that uses faclets
How do i get the value of a TextField component from another page?
how to access faces context and backing beans in a servlet filter