<%@ page contentType="text/html;charset=GB2312" language="java"
pageEncoding="GB2312" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312">
<title>使用request内置对象</title>
</head>
<body bgcolor="#ffc7c7">
<form name="form1" method="post" action="b.jsp">
<p align="center">用户名:<input type="text" name="username"></p>
<p align="center">密 码: <input type="password" name="password"></p>
<p align="center">
<input type="submit" name="Submit" value="OK">
<input type="reset" name="Reset" id="Reset" value="Cancel">
</p>
</form>
</body>
</html>
b.jsp
request.getParameter()可以获取参数
<%@ page contentType="text/html;charset=GB2312" language="java"
pageEncoding="GB2312" import="java.util.*" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312">
<title>b</title>
</head>
<body bgcolor="#ccffcc">
<h1>您刚才输入的内容是:<br></h1>
<%
String username = request.getParameter("username");
String pwd = request.getParameter("password");
out.print("用户名:"+username+"<br>");
out.print("密码:"+pwd+"<br>");
%>
</body>
</html>