Java Reference
In-Depth Information
</form-login-config>
</login-config>
The login form must contain fields for entering a username and password. These
fields must be named j_username and j_password respectively. The authentica-
tion form should post these values to the j_security_check logical name. Here's
a simple login.jsf page that can be used for this purpose:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "http://www.w3.org/TR/xhtml1/
DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/
xhtml"xmlns:h="http://java.sun.com/jsf/html">
<h1>
Please Login
</h1>
<body>
<form method="post" action="j_security_check"
name="loginForm">
<h:panelGrid columns="2">
<h:outputLabel id="userNameLabel"
for="j_username" value="Username:"/>
<h:inputText id="j_username" />
<h:outputLabel id="passwordLabel"
for="j_password" value="Password:"/>
<h:inputSecret id="j_password" />
<h:panelGroup>
<h:commandButton type="submit"
value="Login"/>
</h:panelGroup>
</h:panelGrid>
</form>
</body>
</html>
For the sake of brevity, we won't include the error page, which will simply alert that
the user entered an incorrect combination of username and password. The expected
Search WWH ::




Custom Search