I have two hibernate objects (JobApplication, JobApplicationComments). It's a one-to-many relationship. The JobApplication contains the following.
private Set jobApplicationComments = new HashSet(0);.
The JobApplicaitonComments has the following fields...
private Long commentsId;
private JobApplication jobApplication;
private
String comments;
private Date createdDate;
private String createdBy;
I retreive a JobApplication from the database and can verify this using log4j. However when I use the nested:iterate I get the following error.
javax.servlet.ServletException: Invalid argument looking up property jobApplicationComments[0].comments of bean jobApplication
Here is the code from the
jsp...
<nested
resent name="jobApplication">
<nested:root name="jobApplication">
<nested:write property="firstName"/> <nested:write property="lastName" /><br>
<nested:iterate property="jobApplicationComments" >
<nested:write property="comments" />
</nested:iterate>
</nested:root>
</nested
resent>
Here is the code in my action that I used to verify the correct application and comments.
Iterator myComments = (Iterator)jobApplication.getJobApplicationComments().iterator();
while (myComments.hasNext()) {
JobApplicationComments comments = (JobApplicationComments) myComments.next();
logger.debug("Comments: " + comments.getComments());
}
What am I missing???