📄 login.jsp
字号:
<%@ page language="java" import="java.util.*" pageEncoding="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>My JSP 'login.jsp' starting page</title>
<script type="text/javascript">
function checkLoginName()
{
var fname=document.getElementById("loginName").value;
if(fname.length==0)
{
alert("用户名不能为空!");
return false;
}
return true;
}
function checkLoginPass()
{
var fpass=document.getElementById("loginPass").value;
if(fpass.length==0)
{
alert("用户密码不能为空!");
return false;
}
return true;
}
function validateform()
{
if(checkLoginPass()&&checkLoginName())
{
return true;
}
else
{
return false;
}
}
</script>
</head>
<body>
<center>
<div style="width:98%;position:relative;border:1px solid red;">
<div style="width:98%;height:150px;border:1px solid green;">
<div style="width:35%;float:left;height:100px;border:1px solid green"><img src=""></div>
<div style="width:64%;float:left;display:inline; height:100px;text-align:center;border:1px solid green"><br><br><h2>我学我会,网上订餐系统</h2></div>
<div style="width:99%;height:50px;border:1px solid green;float:left;text-align:middle;"><br>|网站首页|关于我们|订餐帮助|网上订餐|客服中心|</div>
</div>
<div style="width:98%;position:relative;height:400px;border:1px solid blue;">
<div style="width:35%;float:left;height:400px;border:1px solid blue;">
<img src="">
<p></p>
<hr>
<p>
<input type="text" id="myTime" size="20px" >
</p>
<hr>
</div>
<div style="width:64%;float:left;display:inline;height:400px; border:1px solid blue;";>
<div style="width:99%;height:50px;border:1px solid red;"></div>
<div style="width:99%;height:50px;border:1px solid red;"></div>
<div style="width:99%;height:30px;text-align:right; border:1px solid red;"></div>
<div style="width:99%;height:270px;text-align:left;border:1px solid red;">
<br>
<br>
<center>
<form name="myform" method="post" action="Welcome" onSubmit="return validateform()" >
<table>
<tr><td>用户名:</td><td><input type="text" id="loginName" name="loginName" size="15px"></td></tr>
<tr><td>密码:</td><td><input type="password" id="loginPass" name="loginPass" size="15px"></td></tr>
<tr><td><input type="submit" value="提交"></td><td><input type="reset" value="重置"></td></tr>
</table>
</form>
<form name="yourform" method="post" action="result1.jsp">
</form>
</center>
</div>
</div>
</div>
<div style="width:98%;position:relative;height:50px;border:1px solid black;">
版权
</div>
</div>
</center>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -