Nested bean not initialized!!!
843844Apr 15 2008 — edited Apr 16 2008I have a nested bean that I am using to render a page. The bean structure is as below.
class Employee {
NameType EmployeeName;
}
class NameType {
String firstName;
String lastName;
}
Getters and setters declared accordingly. When I render the page, I am using #{Employee.employeeName.firstName} and the page is rendering fine. When I hit submit on the page leaving firstName "blank" I am NOT getting a validation error. Instead I am getting an exception as below.
javax.el.PropertyNotFoundException: Name.Section.xhtml @18,122 value="#{Employee.employeeName.firstName}": Target Unreachable, identifier 'employeeName' resolved to null.
Doesn't JSF work with nested objects, does it not automatically create empty inner objects? Any help appreciated.
Thanks.