📄 login.jsp
字号:
<%--
* @author Rajat Gupta
* @version 1.0
*
* Development Environment : Oracle9i JDeveloper
* Name of the Application : Login.jsp
* Creation/Modification History :
*
* Rajat Gupta 22-Jan-2002 Created
*
* Overview of Application :
* This JSP is the entry point to this Sample. It logins the user to the
* Sample. The user can login as any of the four users :
*
* Customer - This user is taken to the Shopping Cart. He/She
* can purchase a product from here.
* Retail Administrator - This user can see different orders and its status.
* Computer Administrator - This user is the manufacturer of Computers. He/She
* can update the products list of their company.
* Printer Administrator - This user is the manufacturer of Printers. He/She
* can update the products list of their company.
*
* On pressing the 'Login' button, the users will be taken to their respective
* JSP pages.
--%>
<%@ page language="java" %>
<%@ page errorPage="Exception.jsp" %>
<HTML><HEAD>
<script language="JavaScript1.1">
// This function submits the form to the ControllerServlet appending the
// appropriate event.
function submitForm(){
// If the input values are valid, then submit the form.
if (validateForm()){
document.LoginForm.action = "ControllerServlet?Event=Login";
document.LoginForm.submit();
}
}
// This function trims the input String. It removes the leading and trailing
// spaces from the String.
function trim(strText) {
// this will get rid of leading spaces
while (strText.substring(0,1) == ' ')
strText = strText.substring(1, strText.length);
// this will get rid of trailing spaces
while (strText.substring(strText.length-1,strText.length) == ' ')
strText = strText.substring(0, strText.length-1);
return strText;
}
// This function validates the user inputs in this form. It is called before
// submitting the form.
function validateForm() {
var login = trim(document.LoginForm.Login.value);
var password = trim(document.LoginForm.Passwrd.value);
if (login == "") {
alert("Please Enter the User Name");
document.LoginForm.Login.value = "";
return false;
}
if(password == ""){
alert("Please enter a PassWord");
document.LoginForm.Passwrd.value = "";
return false;
}
return true;
}
// This function resets the values entered in the TextBox.
function resetForm(){
document.LoginForm.Login.value = "";
document.LoginForm.Passwrd.value = "";
}
</script>
<TITLE>Advanced Queuing Sample - Sign Up</TITLE>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<link rel="stylesheet" href="stylesheets/styles.css" type="text/css">
<META content="MSHTML 5.00.2314.1000" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff text=#000000>
<form name="LoginForm" method="post">
<!-- Main table -->
<jsp:include page="include/Top.jsp" />
<SPAN
class="greeting"> Welcome to Advanced Queuing</SPAN></td>
<td align="right">
</td>
</tr>
</table>
<!-- 3rd Table ends here for top bar -->
</TD>
</TR>
<TR><TD> </TD></TR>
<TR><TD> </TD></TR>
<!-- Heading of the page goes here -->
<TR><TD class="mainHeading" align="center">Sign In</TD></TR>
<TR><TD> </TD></TR>
<TR>
<TD>
<!-- 5th table starts here working area -->
<TABLE border=0 cellPadding=0 cellSpacing=0 width=970 >
<TBODY>
<TR>
<TD valign="top" width="15%" noWrap> </TD>
<TD vAlign=top width="75%" align="center">
<!-- 6th table starts here-->
<TABLE border=0 width="75%">
<TBODY>
<TR>
<TD class="formHeading" align="right">User Id</TD>
<TD> </TD>
<TD class="data">
<input type="text" name="Login">
</TD>
</TR>
<TR>
<TD class="formHeading" align="right">Password</TD>
<TD> </TD>
<TD class="data">
<input type="password" name="Passwrd" size="20">
</TD>
</TR>
<TR>
<TD colspan=3> </TD>
</TR>
<TR>
<TD colspan=3>
<table width=100%>
<tr>
<td width=5%> </td>
<td class="formHeading" width=40%>
<input type="radio" name="UserType" value="Customer" checked>
Customer
</td>
<td class="formHeading" width=55%>
<input type="radio" name="UserType" value="Retail">
Retail Administrator
</td>
</tr>
<tr>
<td width=5%> </td>
<td class="formHeading" width=40%>
<input type="radio" name="UserType" value="Computer">
Computer Manufacturer
</td>
<td class="formHeading" width=55%>
<input type="radio" name="UserType" value="Printer">
Printer Manufacturer
</td>
</tr>
</table>
</TD>
</TR>
</TBODY>
</TABLE>
<!-- 6th table ends here -->
</TD>
<TD width="10%"> </TD>
</TR>
<TR><TD colspan=3> </TD></TR>
<TR>
<TD colspan=3 align="center">
<img src="images/login12.gif" border=0 width="60" height="32" onMouseUp="submitForm()">
<img src="images/reset12.gif" border=0 width="60" height="32" onMouseUp="resetForm()">
</TD>
</TR>
</TBODY>
</TABLE>
<!-- 5th table ends here working area-->
</TD>
</TR>
<TR>
<TD vAlign=top align=left noWrap> </TD>
</TR>
<TR>
<TD vAlign=top align=left ><image src="images/line.gif" height="3" width="970"></TD>
</TR>
<TR>
<TD height=19 vAlign=top align="left"><font face="Arial, Helvetica" size=-2>
© Copyright 2002 Oracle Corporation.
All rights reserved.</font> </TD>
</TR>
</TABLE>
<!-- Main table ends here-->
</form>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -