Java Reference
In-Depth Information
The new EAR project will be added to the Explorer pane and you will be prompted to switch to
the JEE perspective. Because we are creating only server-based components, we want to stay in the
Web perspective.
5.
Click the No button.
6.
On the New Dynamic Web Project window, click the Finish button.
The TutorialsJSF project will appear in the Explorer pane and the Technology Quickstart pane will be displayed
with links to extensive help information and examples of Web application development.
7.
Close the Technology Quickstart pane.
A JSF project's view is comprised of webpages and Facelets. A Facelet is very similar to a JSP. The difference
and advantage to the Facelet is that JSF 2.0 components can be used instead of the html components. (The JSF
components have more functionality than the html components.)
Tutorial: Creating a Facelet with Page Designer
Using Page Designer, we will create a Facelet and add JSF and SDO components to access the Employee table.
1.
In the Explorer, click on the TutorialsJSF/WebContent folder to select it.
Click File , New , and then Folder .
2.
3.
At the New Folder window, specify c12 as the folder name and click the Finish button.
With the folder c12 still selected, click File , New , and then Web Page .
4.
5.
At the New Web Page window, specify AllEmps as the file name, Facelet as the template
and click the Finish button.
A new Facelet will be created and stored in a file called AllEmps.xhtml in c12 and an editing session started.
Notice that the Palette has a Standard Faces Components tray that contains the JSF visual components “that come
with the JSF framework.” The JSF components provide the same functions as AWT, Swing, and HTML components
but, as mentioned earlier, have additional capability. When a JSF component is added to a Facelet, JSF tags for the
component are added in the Facelet.
Tutorial: Using SDO components
AllEmps will use a Relational Record List (RRL) SDO to display all of the rows from the Employee table. A RRL creates
and uses many JSF components to do this. While creating the RRL, a database connection object will be created
(using a RAD wizard) which is required for the RRL to work. The advantage to creating a connection object in a JSF
application is that any Facelet can access the connection. In other words, you do not have to define a connection in
each Facelet or servlet.
1.
In the Palette, expand the Data and Services tray and select SDO Relational Record List.
2.
In the Page Designer view, click anywhere on the Facelet.
The Add Relational Record List window will be displayed. A name for the RRL must be specified in this window.
3.
In the Name field specify allEmpsRRL (see Figure 12-3 ) and click the Next button.
 
Search WWH ::




Custom Search