如果用户已选择存储在数据库中的性别,请选中单选按钮

时间:2018-01-22 17:18:41

标签: java spring-mvc

如果性别==男性已经在数据库中,请选中单选按钮。

如果性别未存储在数据库中,则提供选择它的选项。

与女性相同

<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>

但我得到了例外。

0 个答案:

没有答案