<input name="hiPartyitems.allowreply" type="radio" value="1" checked />允许评论
<input name="hiPartyitems.allowreply" type="radio" value="0" />不允许评论hiPartyitems.allowreply 在数据库中存的是0和1  我进入修改页面的时候,如何根据hiPartyitems.allowreply的值
来让对应的radio被选中?我的是ssh,struts1.2的

解决方案 »

  1.   


    <input name="hiPartyitems.allowreply" type="radio" value="1" <if test="${hiPartyitems.allowreply == 1}"> checked</if> />允许评论<input name="hiPartyitems.allowreply" type="radio" value="0" 
    <if test="${hiPartyitems.allowreply == 0}"> checked</if>/>不允许评论
      

  2.   

    同意楼上,不过可以使用struts的标签来判断。 
      

  3.   

    最规范的方法是 为这个变量在 actionservlet赋值就好了,hiPartyitems.allowreply