日期:2014-05-17  浏览次数:20631 次

struts2从action传递值到页面的问题
在数据库查询会来一个对象




在页面上也得到了这个数值
${project.selectKye}





可是

<input type="radio"  name="project.selectKye" onclick="getKeyA()" value="A"/>
<input type="radio"  name="project.selectKye" onclick="getKeyB()" value="B"/>
<input type="radio"  name="project.selectKye" onclick="getKeyC()" value="C"/>
<input type="radio"  name="project.selectKye" onclick="getKeyD()" value="D"/>

在页面没有默认选中。求解答。

struts2 radio 前台页面

------解决方案--------------------
<input type="radio"  name="project.selectKye" onclick="getKeyA()"
<c:if test="${project.selectKye eq 'A'}">
checked="checked"
</c:if>

 value="A"/>
  类似下去