blob: 8d773b35ccbfd100cae426f0b7497dcc2a03f399 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
<%--
This JSP displays a login screen. When the user fills out the login
screen, it will submit it to the Login Servlet, which will verify the
user's credentials by calling EJB components.
If the verification is unsuccessful, the login servlet will return
the user to this page to re-enter his credentials.
If the verification is successful, Jasmine's main page will be displayed.
--%>
<html>
<head>
<title>Jasmine's Login page </title>
</head>
<body>
<%-- Include the title, which is "Jasmine's Computer Parts"--%>
<jsp:include page="title.jsp" />
<%-- Indicate the error page to use if an error occurs --%>
<jsp:directive.page errorPage="error.jsp" />
<%-- Display the login form --%>
<h4>Please enter login information</h4>
<p>
<form action="/jasmine/login" method="get">
<table>
<tr>
<td><b>Name:</b></td>
<td>
<input type="text" name="Login" size="19"/>
</td>
</tr>
<tr>
<td><b>Password:</b></td>
<td>
<input type="text" name="Password" size="19"/>
</td>
</tr>
<tr>
<td></td>
<td>
<input type="submit" value="Submit Information"/>
<input type="submit" value="Register"/>
</td>
</tr>
</table>
</form>
<%
// get whether the person logged in successfully
Boolean failed = (Boolean) request.getAttribute("loginFailed");
if (failed != null) {
if (failed.booleanValue() == true) {
%>
<p>
<strong>Could not log in! Please try again.</strong>
<p>
<%
}
}
%>
<%-- Include the page footer --%>
<jsp:include page="footer.jsp" />
</body>
</html>
|