如果性别==男性已经在数据库中,请选中单选按钮。
如果性别未存储在数据库中,则提供选择它的选项。
与女性相同
<c:when test="${sessionScope.player.gender=='male'}">
男
<c:when test="${sessionScope.player.gender=='null'}">
<form:radiobutton path="gender" value="male"/>Male
</c:when>
//if gender==female is already in DB then check radio button
<c:when test="${sessionScope.player.gender=='female'}">
<form:radiobutton path="gender" value="male" checked="true"/>Male
</c:when>
<c:when test="${sessionScope.player.gender=='null'}">
<form:radiobutton path="gender" value="male" />Male
</c:when>
但我得到了例外。