Java Reference
In-Depth Information
Implementing a login error page
The next step we need to do to implement form-based authentication is to develop
a page to be displayed when login fails. A common practice is to allow the user to
attempt to log in again from the error page, this practice is followed in our login
error page.
<%@ page language="java" contentType="text/html; charset=UTF-8"
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<meta http-equiv="Content-Type" content="text/html;
<title>Login Error</title>
There was an error logging in. Please try again.
<br />
<form method="POST" action="j_security_check">
<table cellpadding="0" cellspacing="0" border="0">
<td align="right">Username:&nbsp;</td>
<input type="text" name="j_username">
<td align="right">Password:&nbsp;</td>
<td><input type="password" name="j_password"></td>
<td><input type="submit" value="Login"></td>
If a user enters incorrect credentials when attempting to log in to our application,
he/she will automatically be directed to this page. In our particular implementation
of the login error page, we chose to display an error message and allow the user to
try to log in again, a fairly common practice.
Search WWH ::

Custom Search