Java Reference
In-Depth Information
Figure 12-23.
When the first Standard Faces Component was added to the Facelet (the RRL), RAD created a folder in Java
Resources/src and a java file with the same name as the Facelet. Because AllEmps was in a folder called c12, the
source code folder was called pagecode.c12. The java file holds the source code for the pagecode subclass associated
with the Facelet, that is, the pagecode class holds the Facelet's logic (the Model portion of the app). See Figure 12-24 .
Figure 12-24.
In addition, when the RRL was added to the Facelet (and the connection was defined and assigned to the RRL),
RAD generated all the Java code needed to retrieve the employee information and put that code into AllEmps.java (the
pagecode class). Displaying the AllEmps.java source code will reveal many methods. The one that does most of the
“heavy lifting” regarding accessing the data is called doAllEmpsRRLFetchAction().
As with all java classes, RAD also generates the pagecode class file (the bytecode file) from the pagecode source
(i.e., from the .java file). In the Web perspective, the class files are hidden. To prove that they are there, use Windows
My Computer to display the workspace/project folder. Then drill down into WebContent/WEB-INF/classes/
pagecode/c12 and the AllEmps.class file will be shown.
RAD also put into the Facelet all the JSF and Facelet tags needed to access the pagecode bean, retrieve the data
and display the data. Display the Facelet source code and see all the work RAD has done for you!
When the Facelet is requested, the server creates the pagecode object (from the class file) and defines the
object as a Java bean with a scope of request. The bean name begins with the letters pc (standing for pagecode), an
underscore, and then the name of the Facelet. In this example, the bean is called pc_AllEmps (see Figure 12-25 ).
 
Search WWH ::




Custom Search