A detailed explanation of the code shown in Figure 8.31 follows:
A. Our Java managed bean LogInBean is defined using the tag.
B. The full class name, including the package name and the bean class name, is defined by the tag.
C. The scope of this Java bean is defined by using the tag.

FIGURE 8.31 The application configuration resource file faces-config.xml.
D. The current JSF page, LogIn.jsp, is defined by using the tag.
E. The outcome string SELECTION, which is mapped to the next page Selection.jsp, is defined by using the tag and should be returned by the action method LogInAction() if a matching login user has been found.
F. The name of the next page, Selection.jsp, is defined by using the tag. The points to be noted for this configuration file are:
1) Both the outcome string and the next page should be defined inside the tag, and all navigation pages should be defined inside the tag.
2) The forward-slash symbol “/” before each page name is used to indicate that those pages are located at the current location where the JSF project is located.
3) You can create and edit this configuration file using either the XML editor or the PageFlow design tool.

The code for a sample LogIn.jsp page is shown in Figure 8.32. Let’s have a closer look at this piece of code to see how it works.
A. Two JSF standard customer tag libraries, one for building JSF applications that render to an HTML client and another for representing core actions independently of a particular render kit, are declared first at this page using the <%@taglib%> directive. The uri is used to indicate the valid sites where both libraries are located.
B. All JSF tag components are represented by a tree of components whose root is UIViewRoot, which is represented by the tag. All JSF component tags must be enclosed in this tag.

FIGURE 8.32 The code of a sample LogIn.jsp page.
C. A JSP form, which is submitted to the Web server when a button is clicked, is represented by the tag. The tags representing the form components, such as text fields and buttons, must be nested inside this form tag. The form is identified by its id; here it is a LogInForm.
D. An inputText tag is used to represent an input field to allow the user to enter one line of text string, such as a username in this example. This inputText tag is identified by its id, and the required attribute is set to true. This means that the inputText cannot be empty and must be filled in by the user when the project runs. The value attribute of the input-Text tag is bound to the property userName in the Java bean class, LogInBean, by using the EL value expression. Two points to be noted for this tag are: (1) the value of this tag’s id must be identical to the property name userName defined in the Java managed bean LogInBean, and (2) the value attribute of this tag must be bound to the same username property defined in the Java managed bean LogInBean class. In this way, any update made to the username property in the Java bean can be immediately reflected to the value of the inputText tag and, furthermore, displayed in the input field.
E. A tag is used to make sure that the length of the username is in the range defined by the minimum and maximum attributes.
F. A similar tag is used for the passWord inputText, and it is bound to the passWord prop-erty defined in the Java managed bean LogInBean class. The only difference between this tag and the userName inputText tag is that a tag is used to replace the tag, since this is a way to present a password input style.
G. A tag is also used to validate the length of the passWord to make sure that it is in the required range.
H. A tag is used to present a submit button component, and its action attribute is bound to the action method defined in the Java managed bean LogInBean using the EL value expression “#{LogInBean.LogInAction}”.
Next let’s have a closer look at the code for our Java Bean class.