?? login.jsp
字號:
<%@ page contentType="text/html; charset=gb2312" errorPage="" %>
<%@ page import="java.sql.*,sms.db.*,sms.bean.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
request.setCharacterEncoding("gb2312");
String commitFlag = (String)request.getParameter("submintButton");//得到按鈕事件
String studentId = request.getParameter("studentId");
String pwd = request.getParameter("pwd");
StudentBean studentBean = null;
if(commitFlag != null){//如果單擊了確定按鈕
StudentBean studentBean2 = new StudentBean();
studentBean = studentBean2.queryStuInfo(studentId,pwd);//查詢是否存在該學生信息
if(studentBean != null){//如果存在該學生信息
session.setAttribute("studentBean",studentBean);//將代表該學生信息的Bean保存在session中
RequestDispatcher dispatcher = request.getRequestDispatcher("/loginSuccess.jsp");
dispatcher.forward(request,response);
}
else{//調用腳本語言提示
%>
<script language="javascript" type="">
alert('請檢查學號,密碼是否正確!');
</script>
<%
}
}
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>登錄</title>
<style type="text/css"></style>
<link href="css/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
.style1 {font-family: "華文中宋"}
body {
background-color: #CCCCCC;
}
body,td,th {
color: #330066;
}
</style>
</head>
<body>
<table width="99%" border="0">
<tr>
<td height="71" colspan="3"><h1>請您先登錄系統</h1></td>
</tr>
<tr>
<td width="13%" height="203"> </td>
<td width="42%">
<form action="login.jsp" method="post" name="form1">
<input type=hidden name="commitFlag" value="submit">
<table width="100%" border="0">
<tr>
<td width="46%" height="56" align="right"><span class="style2">學號:</span></td>
<td width="54%"><input name="studentId" type="text" class="text1" size="10" maxlength="10"></td>
</tr>
<tr>
<td height="47" align="right"><span class="style2">密碼: </span></td>
<td><input name="pwd" type="password" class="text1" size="10" maxlength="10"></td>
</tr>
<tr>
<td height="40" align="right"> </td>
<td align="left">
<input name="submintButton" type="submit" class="button1" value="確定" >
<input name="reset" type="reset" class="button1" id="reset" value="取消">
</td>
</tr>
</table>
</form>
</td>
<td width="45%"> </td>
</tr>
<tr>
<td height="235"> </td>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -