?? login.jsp
字號:
<%--
* @author Shefali Bansal
* @version 1.0
*
* Name of the Application : Login.jsp
* Development Environment : Oracle JDeveloper 10g
* Creation/Modification History :
*
* Shefali Bansal 02-Jan-2004 Created
*
* Overview of Application :
* This JSP is displayed if the user logging-in is an Administrator.
* This JSP checks for the Administrator's login credentials.
* On pressing the 'Submit' button, the JSP pages that the Administrator can
* view are displayed.
--%>
<%@ page language="java" %>
<%@ page errorPage="Exception.jsp" %>
<% // Get the type of the user who has logged in
String userType = request.getParameter("UserType");
// If the request parameter was set
if(userType != null) {
// Store the type of user logged in.
session.setAttribute("UserType", userType);
}
%>
<HTML>
<HEAD>
<TITLE>JSP Multimedia Tag Application: Login</TITLE>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<link rel="stylesheet" href="stylesheets/styles.css" type="text/css">
<script language="JavaScript">
/**
* This function does the required validation. If an error is present,
* then it is displayed or else the form is submitted
*/
function submitLoginForm(frmName){
var user = frmName.UserName.value.toUpperCase();
var passwd = frmName.Password.value.toUpperCase();
if ((user=="")||(passwd=="")){
alert("UserName and Password values have to be specified!");
} else if (!(user=="ADMINISTRATOR")){
alert("Only Administrator can Login");
} else if (!(passwd=="WELCOME")){
alert("Incorrect Password !");
} else {
frmName.action = "Admin.jsp";
frmName.submit();
}
}
</script>
</HEAD>
<BODY text=#000000>
<!-- Main table -->
<TABLE border=0 cellPadding=0 cellSpacing=0 height=58 width=100%>
<TR>
<TD valign="top" width="100%">
<!-- Include the static 'Header.jsp' file -->
<%@ include file="Header.jsp" %>
</TD>
</TR>
<TR>
<TD width="100%">
<table WIDTH ="100%" cellspacing=0 cellpadding=0 height="100%"
bgcolor="#FFFFFF">
<tr>
<TD height="100%">
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<!-- Heading of the page goes here -->
<TR>
<TD valign="top" colspan="3" noWrap> </TD>
</TR>
<TR>
<TD valign="top" colspan="3" noWrap> </TD>
</TR>
<TR>
<TD valign="top" colspan="3" noWrap align="center" class=
"heading"> Specify the Login details to enter the application.</TD>
</TR>
<TR>
<TD valign="top" height="20" colspan="3" noWrap> </TD>
</TR>
<TBODY>
<TR>
<TD valign="top" width="35%" noWrap align="right"><img src="images/lockwhite.jpg" width="94" height="107"></TD>
<TD vAlign=top width="30%" align="center">
<form name="LoginFrm" method="post">
<TABLE border=0 width="100%">
<TBODY>
<TR>
<TD align="center" valign="middle"> <span class="formFieldName">
User</span>
<input type="text" name="UserName" value="Administrator">
</TD>
</TR>
<TR>
<TD align="center" valign="middle"><span class="formFieldName">Password</span>
<input type="password" name="Password">
</TD>
</TR>
<TR>
<TD> </TD>
</TR>
<TR>
<TD align="center"> <a href="javascript:submitLoginForm(document.LoginFrm)"><img
src="images/submitbutton.gif" border=0 width="55" height="23" /></a>
<a href="Main.jsp"><img border=0 width="55" height="23" src=
"images/backbutton.gif" /></a> </TD>
</TR>
</TBODY>
</TABLE>
</form>
</TD>
<TD width="35%"> </TD>
</TR>
<TR>
<TD colspan=3> </TD>
</TR>
<TR>
<TD colspan=3> </TD>
</TR>
</TBODY>
</TABLE>
</TD>
</tr>
</table>
</td>
</TR>
<TR>
<!-- Include static 'Footer.jsp' file -->
</TR>
</TABLE>
<!-- Main table ends here-->
</BODY>
</HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -