急急急求助求助

bug的收割机 bug的收割机 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
在客户端我是这么写的问题出在性别上在后台得到的值总是on怎么回事请高手指点
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>注册页</title>
</head>
<body>
<form action="RegisterServlet" method="post">
<table border="1" align ="center">
<tr>
<td>用户名</td>
<td> <input type="text" name="username"></td>
</tr>
<tr>
<td>密码</td>
<td> <input type ="password" name="userpass"></td>
</tr>
<tr>
<td>
男 <input type ="radio" value="male" name="sex" checked>
</td>
<td>
女 <input type ="radio" value="female" name="sex">
</td>
</tr>
<tr>
<td> <input type ="submit" value="提交"> </td>
</tr>
</table>
</form>

在后台是这么接受的
request.setCharacterEncoding("UTF-8");
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
String username = request.getParameter("username");
String userpass = request.getParameter("userpass");
String gender = request.getParameter("sex");
System.out.println(gender);//这里怎么得到的值是on啊请给提示
...全文

相关推荐

评论 15
收藏 已收藏
分享
返回顶部
bug的收割机
Web 开发 81,108 成员 341,721 内容