//大意是这样:当选择项与答案(question.answer)相同时,将该radio设置为checked。请问大家那个if表达式里
//内容该怎么写?
<s:iterator value="choiceList" status="sta">
(<s:property value="#sta.index+1"/>)、
<s:property escape="false" value="question.content"/>(${question.score}分)
<s:iterator value="option">
<s:if test="">
<input type="radio" name="radio${question.id}" value="${sort}" checked="checked"/> ${sort}. <s:property value="value"/>
</s:if>
<s:else>
<input type="radio" name="radio${question.id}" value="${sort}"/> ${sort}. <s:property value="value"/>
</s:else> </s:iterator>
</s:iterator>
不行啊。而且test里面还要写if么。。?
<c:choose>
//使用jstl里的标签搞定了。。还是谢谢sbfivwsll(天涯浪子)
<c:when test="${question.answer==sort}">
<td height="30">
<input type="radio" name="radio${question.id}" value="${sort}" checked="checked"/> ${sort}. <s:property value="value"/>
</td>
</c:when>
<c:otherwise>
<td height="30">
<input type="radio" name="radio${question.id}" value="${sort}" /> ${sort}. <s:property value="value"/>
</td>
</c:otherwise>
</c:choose>
这个貌似是正确答案,我试了下,没出错。虽然用jstl做出来了,不过还是很感谢~