jspTest01.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>使用request对象</title>
</head>
<body>
<% request.setCharacterEncoding("UTF-8"); %>
<%
String name = request.getParameter("name"); //获取用户姓名
String tel = request.getParameter("tel"); //获取电话
String QQ = request.getParameter("QQ"); //获取QQ
%>
姓名:<%=name %> <br>
电话:<%=tel %> <br>
QQ :<%=QQ %> <br>
<h3>阿斯顿发送到</h3>
<%
//获取request内置对象的属性
out.println("协议名称");
out.println(request.getRequestURI() + "<br>");
%>
</body>
</html>
htmlTest01html
<%@ contentType="text/html charset=UTF-8" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>注册</title>
</head>
<body>
<form action="jspTest01.jsp" name="myform" method="post">
姓名:<input type="text" name="name"> <br>
电话:<input type="text" name="tel"> <br>
QQ :<input type="text" name="QQ">
<input type="submit" value="确定">
</form>
</body>
</html>