Hi,
I've got a Student class that looks like this:
public class Student { ... private Teacher matTeacher; ... }
In my JSP, I'm using this property like this:
<html:select property="matTeacher" >
<c:set var="CURTEACHER" value="${student.matTeacher.teacherId}" />
<c:forEach var="teacher" items="${TEACHERMAT}" varStatus="status">
<option value="${teacher.teacherId}" <c:if test="${teacher.teacherId == CURTEACHER}">selected</c:if>>
<c:out value="${teacher.firstName}" /> <c:out value="${teacher.lastName}" />
</option>
</c:forEach>
</html:select>
Showing this works pretty fine, but when I change the dropdown box and submit the form, I get an exception
regarding BeanUtils.populate.
I thought about creating a pseudo-property String matTeacherId which would be used as property in <html:select>, and
when the Student is saved, the Teacher is read from the database and set as matTeacher, but as I already have the
teachers in my CURTEACHER array, this seems kind of waste to me.
Is there any other possibility to solve this?
May be it is meaningful that I use DAOs and Hibernate for persisting my data.
Thanks in advance and kind regards, Simon
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]