login.html
<!DOCTYPE html>
<html>
<head>
<title>登陆</title>
<meta name="keywords" content="keyword1,keyword2,keyword3">
<meta name="description" content="this is my page">
<meta name="content-type" content="text/html; charset=GBK">
<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
</head>
<body>
<form name=form1 method=post action=Login.jsp>
用户名:<input type=text name=txtname><br />
密码 :<input type=password name=password><br />
<input type=submit name=ok
value=登陆> <input type=reset name=reset value=重置>
</form>
</body>
</html>
login.jsp
<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<%
request.setCharacterEncoding("gbk");
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>提取登陆信息</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<%
String content = request.getParameter("txtname");
String pwd = request.getParameter("password");
%>
<h2>
用户名:<%=content%></h2>
<h2>
密码 :<%=pwd%></h2>
</body>
</html>