-1
我想从循环中读取一个密钥和list
的值。 下面是我试过的代码片段,但它不工作。Struts 2中来自scriplet的单选按钮的列表属性值
<c:forEach items="${mylist}" var="title">
<c:set var="id" value="${title.key.id}"/>
<%Integer idInt = (Integer)pageContext.getAttribute("id");
String idStr = "";
if(idInt != null && idInt.intValue() > 0){
idStr = idInt.toString();
}%>
<s:radio theme="simple" name="selectedOption" list="#{idStr:title.value}"/>
</c:forEach>
为什么要放大?为什么要'forEach'?正在尝试做什么? – 2014-11-06 12:44:21
@AleksandrM:我正在尝试从循环中读取列表的键和值。 – sweety 2014-11-06 12:48:54
列表的关键?你的意思是指数? – 2014-11-06 12:56:03