• 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:
  • Devaka Cooray
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
Bartenders:

Acessing a managed bean from another managed bean

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am new to jsf.My problem is I am not able to access a property value from one bean in another bean..can somebody please help.
I have an addressBook bean.I want to access this bean in my groups bean,where both my beans are session scoped. I Tried using @ManagedProperty but did not get a result.This is how i do it.

@ManagedBean
@SessionScoped
public class Groups extends GroupStore {
@ManagedProperty(value="#{addressBook}")
private AddressBook a;
public void setA(AddressBook a) {
this.a = a;
}


But it gives this eror .

Unable to create managed bean groups. The following problems were found: - Property addressBook for managed bean groups does not exist. Check that appropriate getter and/or setter methods exist.
 
Saloon Keeper
Posts: 29004
214
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
Welcome to the Javaranch, Anu!

You're doing it right. Almost.

You apparently didn't publish a bean named "addressBook". If you're using the annotations on the AddressBook class, make sure that you have the "@ManagedBean" annotation set up correctly in AddressBook.java.

 
Anu kuriakose
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you soo much for the reply.....ys now its working properly. I had done some mistakes in my web-config.xml Thank u:)
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I having the same problem.
How to get value from extends bean?

in my class
public class c002Bean extends LoginMB {
....


}

in my LoginMB i have a value of email field.
how do?
extendsbean.jpg
[Thumbnail for extendsbean.jpg]
 
If I'd had more time, I would have written a shorter letter. -T.S. Eliot such a short, tiny ad:
Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders
https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing
reply
    Bookmark Topic Watch Topic
  • New Topic