Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Nested bean not initialized!!!

843844Apr 15 2008 — edited Apr 16 2008
I 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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 14 2008
Added on Apr 15 2008
6 comments
261 views