| Author |
The Managed Bean in the faces-config.xml File
|
Daniel Gee
Ranch Hand
Joined: Aug 29, 2003
Posts: 202
|
|
I am still very new to JSF. I am confused about the managed bean. For example, I have a button in my web page. A click on this button invokes an action; say, ListAction.java. In this ListAction class, I instantiate a business delegate; say, ListPersonnel.java and call a method in this business delegate to return an ArrayList: personnel. Of course, this business delegate goes through facade, DAO, etc. to populate the ArrayList. This ArrayList is a collecation of a JavaBean called PersonnelBean that gets and sets a number of personnel information; such as ssn, name, etc. Upon this ArrayList is successfully populated and received by the ListAction class, I am going to display a web page with a table. In JSF, it is <h ataTable ...>. My questions are regarding the managed bean in the faces-config.xml file. 1. Which one is my <managed-bean-class>? packageName.ListAction? or packageName.PersonnelBean? or something else? 2. What should be my <managed-bean-name>? I guess that I can give a name I like. Is it right? What about xyz? 3. Then, how do I specify the "value" attribute of my <h ataTable ...> tag when I display a web page to show the data table? Is it correct to specify value="#{xyz.personnel}"? What is the correct specification if it is wrong? 4. I guess that I can give any name to the "var" attribute in the <h ataTable ...> tag. Is it right?
|
 |
Kevin Galligan
Ranch Hand
Joined: Aug 10, 2005
Posts: 70
|
|
1. Which one is my <managed-bean-class>? packageName.ListAction? or packageName.PersonnelBean? or something else? ListAction 2. What should be my <managed-bean-name>? I guess that I can give a name I like. Is it right? What about xyz? listAction, or anything else you'd like (that is a valid name) 3. Then, how do I specify the "value" attribute of my <h ataTable ...> tag when I display a web page to show the data table? Is it correct to specify value="#{xyz.personnel}"? What is the correct specification if it is wrong? value="#{listAction.personnel}" This would call the function 'getPersonnel' that would return your List object 4. I guess that I can give any name to the "var" attribute in the <h ataTable ...> tag. Is it right? Any valid name
|
 |
 |
|
|
subject: The Managed Bean in the faces-config.xml File
|
|
|