<%
String handlestr = request.getAttribute("handlecodestr").toString();
request.setAttribute("handlecodestr", handlestr) ;
%>
<c:forEach items="${handlelist}" var="handles" varStatus="s" >
<!-- <logic:iterate id="handles" name="handlelist" scope="request"> -->
<tr>
<td align="center" width="199" height="27">
<input type="checkbox" name="handles"
value="${handles.mhCode }"
<c:if test="${handlestr eq handles.mhCode}">
id="handles"
checked </c:if> />
</td>
<td height="27">
${handles.mhName}
</td>
</tr>
<!-- </logic:iterate> -->
</c:forEach>jsp页面的代码。 checked 选不中。 请问下怎么回事。
if成功后,checked都选不中。
String handlestr = request.getAttribute("handlecodestr").toString();
request.setAttribute("handlecodestr", handlestr) ;
%>
<c:forEach items="${handlelist}" var="handles" varStatus="s" >
<!-- <logic:iterate id="handles" name="handlelist" scope="request"> -->
<tr>
<td align="center" width="199" height="27">
<input type="checkbox" name="handles"
value="${handles.mhCode }"
<c:if test="${handlestr eq handles.mhCode}">
id="handles"
checked </c:if> />
</td>
<td height="27">
${handles.mhName}
</td>
</tr>
<!-- </logic:iterate> -->
</c:forEach>jsp页面的代码。 checked 选不中。 请问下怎么回事。
if成功后,checked都选不中。
解决方案 »
- FckEditor出现的HTML标记问题
- JSP页面中序列号自动累加
- 关于Hibernate ehcache二级缓存的问题(有点难度), 请帮忙, 谢谢!
- msn发送文件提示版过旧
- 如何去掉webwork标签自动生成的table
- 200分问问题(2)
- 小弟求一个能在jboss下运行j2ee(ejb)实例,多谢!
- 我是初学者,向大家请教个问题,可能很简单但我不会!!
- 请问谁运行过《Java XML 编程指南》中的代码?
- JSCH调用远程linux shell 执行APK自动打包-shell执行了,但打包无效。
- 急急急!socket链接服务器,怎么得到链接成功后返回的代码?
- 关于Srping定时器jobClass的一个问题,在线等....[
<td align="center" width="199" height="27">
<input type="checkbox" name="handles" value="${handles.mhCode }"
<c:if test="${handlestr eq handles.mhCode}">
id="handles" checked
</c:if>
/>
</td>
跟你整理了一下,这个代码能这么写么?
改成下面这样吧:<td align="center" width="199" height="27">
<c:if test="${handlestr eq handles.mhCode}">
<input type="checkbox" name="handles" value="${handles.mhCode }" id="handles" checked />
</c:if>
</td>
有的checked=“checked”,
有的checked=“true”
可以试试。
一般页面显示的问题从生成好的html源文件入手,看看页面标签是什么样改起来也容易
"${handlestr eq handles.mhCode ? 'id=\'handles\' checked ':''} ";
"${handlestr == handles.mhCode ? 'id=\'handles\' checked ':''} ";