- 后台返回具体的用户数据,包含性别等单选值。
- 前台Jsp中具体代码操作:
<label >性别:</label>
<input type="radio" name="sex" value="男" <c:if test="${user.sex== '男'}">checked="checked"</c:if> > 男
<input type="radio" name="sex" value="女"<c:if test="${user.sex== '女'}">checked="checked"</c:if> > 女

- 记得导入jstl的命名空间
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

2624

被折叠的 条评论
为什么被折叠?



