📄 login.jsp
字号:
<%@ page contentType="text/html;charset=gb2312"%>
<%-- 进行登录验证 --%>
<%
String user = request.getParameter( "user" );
String password = request.getParameter( "password" );
if( "scott".equals( user ) && "tiger".equals( "tiger" ) )
{
%>
<jsp:forward page="success.jsp">
<jsp:param name="user" value="<%=user%>" />
</jsp:forward>
<%
}
%>
<html>
<head>
<title>登录页面</title>
</head>
<body>
<center>
<table border="0" width="300">
<tr>
<td colspan="2" align="center">用户登录</td>
</tr>
<%-- 输出错误信息 --%>
<%
if( null!=user )
{
%>
<tr>
<td colspan="2">用户名密码验证失败!请重新输入!</td>
</tr>
<%
}
%>
<form method="post" action="login.jsp" />
<tr>
<td align="right">登录名:</td>
<td><input type="text" name="user"></td>
</tr>
<tr>
<td align="right">密码:</td>
<td><input type="password" name="password"></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="登 录"></td>
</tr>
</form>
</table>
</center>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -