I want to load a Person pojo from database and display the firstName as opposed to creating a new Person pojo.
How do I wire the database loading logic with JSF?.
[ October 14, 2006: Message edited by: Chase Bonham ]
Hi Chase
You could create a managed form bean, HelloForm.java perhaps, which would act as a layer between your Person.java and the JSP.
The HelloForm.java backing bean could have a method, loadPerson() , that gets a database connection and retrieves a Person object. This object should be referenced in HelloForm.
You can then create a navigation rule in faces-config.xml that calls your HelloForm.loadPerson() method when the JSP loads.
Referencing the Person object through the HelloForm would look something like this: