index.jsp
Created with JBuilder
<%@ include file="Header.jsp" %>
<html>
  <head>
    <title>Ldap Authentication</title>
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function checkLogin(LoginForm) {
      var allowChar = /^[a-zA-Z]+$/;
      if (LoginForm.userName.value == "") {
        alert("Please fill in username.");
        LoginForm.userName.focus();
        return false;
      }
      if (LoginForm.userName.value != "") {
        var allowUserName = (LoginForm.userName.value).match(allowChar);

        if (allowUserName == null) {
          alert("User name can only contains characters.");
          LoginForm.userName.focus();
          return false;
        }
      }
      if (LoginForm.password.value == "") {
        alert("Please fill in password.");
        LoginForm.password.focus();
        return false;
      }
      return true;
    }
    //-->
    </script>
  </head>
<body>
<p><img src="logo.gif"></img></p>
<hr>
<table id="ErrorMessageTable">
  <tr>
    <td><font color="red"><c:expr value="$errorMessage"/></font></td>
  </tr>
</table>
<p>
<form id="LoginForm" method="post" action="controller" onSubmit="return checkLogin(this)">
<input type="hidden" name="CommandName" value="Login">
  <table border="0" align="center">
    <tr>
      <td>User Name:</td>
      <td>
        <input type="text" name="userName" length="8" maxLength="8">
      </td>
    </tr>
    <tr>
      <td>Password:</td>
      <td>
        <input type="password" name="password" length="8" maxLength="8">
      </td>
    </tr>
    <tr>
      <td colspan="2">
        <div align="center">
          <input type="submit" name="Login" value="Login">
        </div>
      </td>
    </tr>
  </table>
</form>
<%@ include file="Footer.jsp" %>

index.jsp
Created with JBuilder