jsp的一题

来源:百度知道 编辑:UC知道 时间:2024/06/21 07:40:23
通过html访问jsp页面,问题可以跳转到jsp页面,就是显示不出来...
html的部分
<%@ page contentType="text/html;charset=gb2312" %>
<html>
<body bgcolor=cyan>
<form action="member.jsp" method=post name=form>
<font color=blue size=5 >
<center>
加入会员
<br>姓名: <input type="text" name="peoplename">
<br>性别:<input type="radio" name="r" value="男" checked=checked>男
<input type="radio" name="r" value="女" >女
<br>你是否愿意成为本班的一员:
<br><input type="radio" name="g" value="愿意" checked=checked>愿意
<input type="radio" name="g" value="不愿意" >不愿意
<br><input type="submit" value="sumbit"> <input type="reset" value="reset">
</center>
</font>

jsp里面没有错误。
<br>姓名: <input type="text" name="peoplename">
<br>性别:<input type="radio" name="r" value="男" checked=checked>男
<input type="radio" name="r" value="女" >女
<br>你是否愿意成为本班的一员:
<br><input type="radio" name="g" value="愿意" checked=checked>愿意
<input type="radio" name="g" value="不愿意" >不愿意
<br><input type="submit" value="sumbit"> <input type="reset" value="reset">
问题出在这里,你在这里写了4个radio(单选框),只能选一个选项提交,也就是说只能提交一个数据,到下个页面也就取不到第二个数据了。这里改成两个select标签就好了:
<select name="r">
<option value="女">--女--</option>
<option value="男">--男--</option>
</select>
<select name="g">
<option value=&