JSP---根据值让某一Radio处于选中状态

<tr>
<td>
性别
</td>
<%
String sex = student.getStud_sex();
%>
<td>
<input type="radio" value="男" name="stud_sex"
<%if (sex.equals("男"))
out.print("checked");%> />

<input type="radio" value="女" name="stud_sex" <%if (sex.equals("女"))
out.print("checked");%> />

</td>
</tr>

原文地址:https://www.cnblogs.com/beast-king/p/3847985.html