代码
login界面
<%@ page language="java" contentType="text/html" pageEncoding="utf-8" %>
<html>
<head>
<title>简单request获取</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="login_deal.jsp">
用户名:
<input name="username" type="text" id="username"/>
密 码:
<input name="pwd" type="password" id="pwd"/>
<input type="submit" name="Submit" value="提交"/>
<input type="reset" name="Reset" value="重置"/>
</form>
</body>
</html>
login_deal界面
<%@ page language="java" contentType="text/html" PageEncoding="utf-8" errorPage=""%>
<html>
<head>
<title>login deal</title>
</head>
<body>
<%
request.setCharacterEncoding("utf-8");
String username=request.getParameter("username");
String pwd=request.getParameter("pwd");
out.println("用户名为:"+username);
out.println("密码为:"+pwd);
%>
</body>
</html>
运行效果