<%@ page language="java" import="java.util.*" contentType="text/html;charset=gb2312" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
<form action="deal.jsp" method="post">
账号:<input type="text" name="username"/><br>
密码:<input type="password" name="password"/><br>
姓名:<input type="text" name="name"/><br>
性别:<input type="radio" name=sex value="男" checked />男
<input type="radio" name=sex value="女" checked />女<br>
爱好:<input type="checkbox" name="interest" value="看书">看书
<input type="checkbox" name="interest" value="打篮球">打篮球
<input type="checkbox" name="interest" value="旅行">旅行
<input type="checkbox" name="interest" value="编程">编程
<input type="submit" value="递交"/>
<input type="reset" value="重置"/>
</form>
</body>
</html>
<%@ page language="java" import="java.util.*" contentType="text/html;charset=gb2312" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
</head>
<body>
<%-- 设置页面的编码,--%>
<%
request.setCharacterEncoding("gb2312");
%>
账号:${param.username }<br>
密码:${param.password}<br>
姓名:${param.name}<br>
性别:${param.sex }<br>
爱好:${paramValues.interest[0] }
${paramValues.interest[1] }
${paramValues.interest[2] }
${paramValues.interest[3] }
</body>
</html>
转载于:https://blog.51cto.com/7113016/1704907