⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 login.jsp

📁 相当板扎,采用贝叶斯公式的垃圾邮件过滤程序
💻 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>&nbsp;</TD>
              </TR>
              <TR>
                <TD valign="top" colspan="3" noWrap>&nbsp;</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>&nbsp;</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> &nbsp;&nbsp;&nbsp; 
                          <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">
                          &nbsp;&nbsp;&nbsp;&nbsp; </TD>
                      </TR>
                      <TR>
                        <TD>&nbsp; </TD>
                      </TR>
                      <TR>
                        <TD align="center"> <a href="javascript:submitLoginForm(document.LoginFrm)"><img
                        src="images/submitbutton.gif" border=0 width="55" height="23" /></a> 
                          &nbsp; <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%">&nbsp;</TD>
              </TR>
              <TR>
                <TD colspan=3>&nbsp;</TD>
              </TR>

              <TR>
                <TD colspan=3>&nbsp;</TD>
              </TR>
              </TBODY>
            </TABLE>
            
          </TD>
        </tr>
      </table>
    </td>
   
  </TR>
  <TR>
    <!-- Include static 'Footer.jsp' file -->
    <%@ include file="Footer.jsp" %>
  </TR>
</TABLE>
<!-- Main table ends here-->
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -