You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Stephen Souness <so...@hotmail.com> on 2005/03/04 01:02:12 UTC
nested loops with jstl
Hi all,
I have a basic survey creation form which is backed by three levels of
form bean - survey -> questions -> answerOptions.
Using the following JSTL gets me this exception:
javax.servlet.jsp.el.ELException: Unable to find a value for
"answerOptions" in object of class "java.util.HashMap$Entry" using
operator "."
Do I need to somehow specify the type of the Question, or is there a
more elegant solution?
<c:forEach var="currentQuestion" items="${editSurveyForm.questions}"
varStatus="questionStatus">
<tr>
<td>
<html:text
property="question[${questionStatus.index+1}].questionText" />
</td>
</tr>
<c:forEach var="currentAnswer"
items="${currentQuestion.answerOptions}" varStatus="answerStatus">
<tr>
<td><html:text property="answerOption[$answerStatus.index+1].text"
/></td>
</tr>
</c:forEach>
</c:forEach>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org