📄 login.jsp
字号:
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
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>
<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>
<script type="text/javascript">
function check(){
if(form1.ur.value==""){
alert("用户名不能为空");
form1.ur.focus();
return false;
}
if(form1.ps.value==""){
alert("密码不能为空");
form1.ps.focus();
return false;
}
}
</script>
<form name="form1" method="post" action="servlet/loginservlet" onSubmit="return check()">
<table width="285" border="1" align="center">
<tr>
<td width="69">用户名</td>
<td width="200"><input type="text" name="ur"></td>
</tr>
<tr>
<td>密码</td>
<td><input type="password" name="ps"></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input name="log" type="submit" id="log" value="登录">
<input type="reset" name="Submit" value="重置">
</div></td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -