Using Java Beans Technology for Java Web Applications 2 – Develop Java Web Applications to Access Databases

There is no difference between creating a help class and creating a Java bean class. In fact, the help class FacultyBean.java we created in the last section is a Java bean class.The JSP provide three basic tags for working with beans. <jsp:useBean id=”bean name” class=”bean class” scope = “page | request | ses-sion |application”/>The definitions … Read moreUsing Java Beans Technology for Java Web Applications 2 – Develop Java Web Applications to Access Databases

Using Java Beans Technology for Java Web Applications – Develop Java Web Applications to Access Databases

8.1.5   Using Java Beans Technology for Java Web Applications In recent years, the Java beans technique has been widely applied in Java Web applications. In fact, a Java bean can be considered an extended Java help class, as we discussed in the previous sections, and the main purpose of a Java bean is to handle … Read moreUsing Java Beans Technology for Java Web Applications – Develop Java Web Applications to Access Databases

Modify the Help Class FacultyBean to Make It a Java Bean Class – Develop Java Web Applications to Access Databases

8.1.5.1   Modify the Help Class FacultyBean to Make It a Java Bean Class First we need to create a new Java Session Bean class named FacultyBean in the NetBeans IDE. Then we need to add seven setter() methods into this bean class. Your finished Java bean class, FacultyBean.java, is shown in Figure 8.19. All modified … Read moreModify the Help Class FacultyBean to Make It a Java Bean Class – Develop Java Web Applications to Access Databases

Build a New Starting Web Page, FacultyBeanPage – Develop Java Web Applications to Access Databases

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 … Read moreBuild a New Starting Web Page, FacultyBeanPage – Develop Java Web Applications to Access Databases

Using JavaServer Faces Technology for Java Web Applications – Develop Java Web Applications to Access Databases

8.1.6   Using JavaServer Faces Technology for Java Web Applications JavaServer Faces provides new techniques and components for building user interfaces (UIs) for server-side applications. In fact, JSF is a server-side technology for developing Web applications with rich user interfaces. Before JavaServer Faces, developers who built Web applications had to rely on building HTML user interface … Read moreUsing JavaServer Faces Technology for Java Web Applications – Develop Java Web Applications to Access Databases

The Application Configuration Resource File, faces-config.xml – Develop Java Web Applications to Access Databases

8.1.6.1   The Application Configuration Resource File, faces-config.xml Navigation from one page to another can be done in two ways. One way is to use code directly by writing a JSP tag such as <jsp:forward /> or an HTML hyperlink in the JSF file. Another way that is provided by JSF is to use the application … Read moreThe Application Configuration Resource File, faces-config.xml – Develop Java Web Applications to Access Databases

Sample JavaServer Face Page Files 2 – Develop Java Web Applications to Access Databases

An interesting thing in step E in this piece of sample code is that an embedded backing bean property, userName, has been bound to the value attribute of the inputText tag. Recall that we used either the getAttribute() method of a JSP implicit object session (session.getAt-tribute()) or the getProperty() method of a Java bean to … Read moreSample JavaServer Face Page Files 2 – Develop Java Web Applications to Access Databases

Sample JavaServer Face Page Files – Develop Java Web Applications to Access Databases

8.1.6.2  Sample JavaServer Face Page FilesTwo JSF files are shown in Figures 8.25 and 8.26. In Figure 8.25, a Current.jsp page that works as a receiving page to get the username is shown. In Figure 8.26, Next.jsp, which works as a responding page to select and return a matching password based on the username to … Read moreSample JavaServer Face Page Files – Develop Java Web Applications to Access Databases

The Java Bean Class File – Develop Java Web Applications to Access Databases

8.1.6.3   The Java Bean Class File The Java bean class used in JSF pages is very similar to the FacultyBean class we built in Section 8.1.5.1. Like most Java bean classes, it should contain setter and getter methods as well as some special methods to process the business logic. In addition, Java beans need to … Read moreThe Java Bean Class File – Develop Java Web Applications to Access Databases

A Complete Run Procedure of JSF Web Applications – Develop Java Web Applications to Access Databases

8.1.6.5  A Complete Run Procedure of JSF Web Applications As we mentioned, a UI component represented by a JSF tag in a JSP page can be bound to a Java bean’s property or method. To separate the presentation and business logic, we can use JSP pages to present our GUI and Java beans to store … Read moreA Complete Run Procedure of JSF Web Applications – Develop Java Web Applications to Access Databases



                    Blog, Contribute ,Privacy,Terms of Use,Trademarks,© estherknow 2024