JSP-select 表单数据回显中 selected=“selected”失效

时间:2014-01-15 23:59:04   收藏:0   阅读:1198

开始写成:  

1 <select>
2      <option select="${foo==‘Y‘?‘selected‘:‘‘}"></option>  
3      //或者
4      <option selected="<c:if test=‘${foo==‘Y‘}‘>‘select‘</c:if>"></option>                   
5 </select>

都不成功,最后改为:

<select>
    <option <c:if test="${foo==‘Y‘}">selected="selected"</c:if>></option>
</select>

成功的感觉真好,哈哈

原文:http://www.cnblogs.com/twowood/p/3516039.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!