1.index.jsp登陆界面:
<%@ page language="java" import="java.util.*" pageEncoding="GB2312"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%session.invalidate();%> <%--销毁所有session对象--%>
<!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>
<center>
<hr>
请输入用户名,默认的为Guest
<form action="checklogin.jsp" mothod=get>
<table width="40%" border="1">
<tr bgcolor="#336600">
<td><div align="center"><font color="FFFFFF">用户登陆</font></div></td>
</tr>
<tr align="center" bgcolor="#CCCCCC">
<td>用户名:<input type="password" name="userID"></td>
</tr>
<tr align="center" bgcolor="#CCCCCC">
<td>口 令:<input type="password" name="password"></td>
</tr>
<tr align="center" bgcolor="#CCCCCC">
<td><input type="submit" value="登陆"></td>
</tr>
</table>
</form>
</center>
</body>
</html>
2.checklogin.jsp登陆认证页面:
<%@ page language="java" import="java.util.*" pageEncoding="GB2312"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<jsp:useBean +unit;
list.put(item, str);
}
}
相关文章: