8.1.5.2 Build a New Starting Web Page, FacultyBeanPage
The preview of this page is shown in Figure 8.21.
The difference between this starting page and the FacultyPage.jsp starting page we built in the last section is: in FacultyPage.jsp, we used a JSP built-in or implicit object session to transfer data between the page and the help class. However, in the new starting page, FacultyBeanPage. jsp, we need to use the properties defined in the Java bean class to transfer data.
That is, we need to use the Java bean’s getter() method to replace the session.getAt-tribute() methods embedded in the value tag of each text field to retrieve and display the associated column queried from the Faculty Table in our sample database in each text field in the new starting page.
The code for the new starting page is shown in Figure 8.22. The modified parts are in bold.
Let’s have a closer look at this piece of code to see how it works.
A. A JSP tag declared to use a Java bean is put at the beginning of this page to indicate that a Java bean will be called to perform JDBC- and database-related queries or business logic, and the result will be retrieved and reflected in this starting page.
B. The next page is changed to FacultyBeanQuery.jsp in the action tag of the form, which means that the page and all data in this starting page will be forwarded to the next page if the submit button is clicked by the user from this page.
C. From step C to step I in the Figure, the different Java bean’s getter() methods are executed to retrieve the matching columns from the queried result and display them one by one in each associated text field.

FIGURE 8.21 The new starting Web page, FacultyBeanPage.jsp.

FIGURE 8.22 The code for the new starting page, FacultyBeanPage.jsp.
From this piece of code, you can see how easy it is to transfer data between the starting Web page written in either HTML or JSP and Java bean class by using the Java bean’s properties.
From the examples discussed previously, it can be seen that the JavaServer Pages technology provides good communication and data passing methods between the Servlet and client Web pages; however, it does not provide direct binding and mapping between the Web page’s components and the server-side code. This kind of binding and mapping plays a more important role in today’s com-plicated and multi-tier Web applications. To meet this need, a new technology has been introduced in recent years, JavaServer Faces technology.
With this new technology, all Web components can be installed and distributed in a Web page by using JSF tags. Also, more importantly, all of these components can be bound to the server-side properties and functions using the so-called backing beans or Java managed beans. By using a Unified Expression Language (EL) value expression, the value of the property of a mapped or bound Web component can be easily picked up from a backing bean on the server side.