📄 a04beb194e18001e1afee88a53cb45b1
字号:
<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String errors=(String)request.getAttribute("errors");
String userName=(String)session.getAttribute("userName");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<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>
<script language="JavaScript" type="text/JavaScript">
function validatefun(){
//用户输入名的验证
if(document.form1.userName.value==""){
alert("请输入您的用户名!");
return false;
}
if(document.form1.passWord.value==""){
alert("请输入您的密码!");
return false;
}
return true;
}
</script>
</head>
<body>
<%if(userName==null){ %>
<form name="form1" method="post" action="LoginServlet" onSubmit="return validatefun();">
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="border">
<tr>
<td colspan="2">
<div align="center"><font color="#FF99FF" size="6"><strong>用户登录</strong></font></div>
</td>
</tr>
<tr>
<td>用户名: </td>
<td><input name="userName" type="text" size="10" maxlength="20"></td>
</tr>
<tr>
<td>密 码:</td>
<td><input name="passWord" type="password" size="10" maxlength="20">
</td>
</tr>
<%if(errors!=null){ %>
<tr><td colspan=2><font color="ff0000"><%=errors%></font></td></tr>
<%} %>
<tr>
<td colspan="2">
<div align="left">
<input type="submit" name="Submit" value="登录">
<input type="reset" name="Reset" value="重置">
<a href="regist.jsp">新用户注册</a></div></td>
</tr>
<input type="hidden" name="method" value="userLogin"/>
</table>
</form>
<%}else{ %>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="border">
<tr>
<td colspan="2">欢迎您!<font color="ff0000"><%=userName %></font></td>
</tr>
<tr>
<td><a href="userOrder.jsp" class="blue2">订单管理</a></td>
<td><a href="userCar.jsp" class="blue2">购物车管理</a></td>
</tr>
<tr>
<td><a href="userInfo.jsp" class="blue2">信息管理</a></td>
<td><a href="logout.jsp" class="blue2">安全退出</a></td>
</tr>
</table>
<%} %>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -