In this tutorial, you will use NetBeans IDE 6.5 to create an application that includes two JSF 1.2 (Woodstock) page fragment components. A fragment is used to hold the application's logo. Another fragment is used to hold links to navigation between the two pages of the application.
Examples of company logos used in this tutorial |
»sky.jpg |
This tutorial can be used to work with the following technologies and resources:
JavaServer Faces Components/ Java EE Platform |
1.2 and Java EE 5* 1.1 and Java EE 1.4 |
Travel Database |
Not required |
* To take advantage of the Java EE 5 features of NetBeans IDE 6.0, use an application server that is fully compatible with the Java EE 5 specification, such as GlassFish.
This tutorial is written to apply to the GlassFish V2 application server. If you use a different server, consult the release notes and FAQs for known issues and solutions. To learn more about supported servers and Java EE platforms, see the release notes.
About page Fragments
A page fragment is a part of a page, such as a header, footer, or navigation bar, which can be reused in other pages. For example, you might want to place a common element in a page fragment, such as an image or search field, and then include the fragment as a header in all the pages in your application. You may also want to include your company name and copyright information in another page fragment, and use this fragment as the footer for your application. Like the main page, a page fragment is a JSP page with a page Bean associated with itself, but the file name extension for the page fragment is JSPF rather than a JSP.
Design a page that contains a page fragment
You will begin this tutorial by creating the home page for your application. You will then create a header fragment and a navigation fragment and include the fragments in the home page.
Create a WEB application project called Fragmentexample. Enables the Visual Web JavaServer Faces framework.
Figure 1 shows the page you will create in the following steps:
Figure 1: The home page for the application