JSF 1.2 tutorials and examples for beginners

Welcome to world of java Server faces (JSF). In this JSF tutorial you will learn basic and advanced examples using Eclipse and Apache tomcat Server. JSF is used to develop rich user interface web application. JSF provides a rich quantity of UI components to develop a wonderful web application.

 

Till now I have developed 19 web applications in JSF and desirous to do more and more. I was having knowledge of Struts1.1, JSP, Servlet etc when I started learning JSF in Year 2008. I enjoyed JSF learning a lot. JSF has reduced the complexity of page design, navigation between two pages, validations and many more things as compared to Struts-1.1. JSF-1.2 is easy to learn. Now at the time of writing this tutorial current version of JSF is 2.0 and Struts 2.0 is also available for developers. In this JSF tutorial we will learn JSF 1.2 with Examples.

Tutorial 1 – Basic Examples In JSF :

  1. JSF Hello World Example – In this JSF Example we will demonstrate hello world example in JSF
  2. Using Java Script In JSF – In this JSF example we will demonstrate how to use Java Script in JSF. We will see how can we validate attributes in JSF.

Tutorial 2 – Selection Tags in JSF with Examples :
JSF has seven tags for making selections:

  1. JSF Select Boolean Checkbox (h:selectBooleanCheckbox) Example – In this example we will demonstrate how to use Select Boolean Checkbox (h:selectBooleanCheckbox) in JSF.
  2. JSF Select Many Checkbox (h:selectManyCheckbox) Example – In this example we will demonstrate how to use Select Many Checkbox (h:selectManyCheckbox) in JSF.
  3. JSF Select One Radio (h:selectOneRadio) Example – In this example we will demonstrate how to use Select One Radio (h:selectOneRadio) selection tag in JSF.
  4. JSF Select One Listbox (h:selectOneListbox) Example – In this example we will demonstrate how to use Select One Listbox (h:selectOneListbox) in JSF.
  5. JSF Select Many Listbox (h:selectManyListbox) Example – In this example we will demonstrate how to use Select Many Listbox (h:selectManyListbox) in JSF.
  6. JSF Select One Menu (h:selectOneMenu) Example – In this example we will demonstrate how to use Select One Menu (h:selectOneMenu) in JSF.
  7. JSF Select One Menu (h:selectManyMenu) Example – This example is in process. We will publish it soon. Till now please take help from other resources.

Tutorial 3 – Data Tables (h:dataTable) Example In JSF :

Data table (h:dataTable) is one of the most required UI component which is used widely in every web project. Data table (h:dataTable) is being used to display list of objects in well organized way.
JSF Data Table (h:dataTable) Example – In this example we will demonstrate how to use Data Table (h:dataTable) in JSF.

Tutorial 4 – Other JSF Examples :
JSF Graphic Image (h:graphicImage) Example – In this example we will demonstrate how to use Graphic Image in JSF.

Tutorial 5 – Internationalization, i18n, Message Bundle, Resource Bundle in JSF :
we will demonstrate how to implement internationalization, localization, i18n in JSF with Examples. We have two ways in JSF to do internationalization, localization, i18n.

  1. Load Bundle (f:loadBundle) – Load Bundle (f:loadBundle) can be used directly in JSF pages.
  2. Resource Bundle  – Resource Bundle can be configured in faces-config.xml file and can be reused in JSP pages.

Here is an example to demonstrate how to use Load Bundle (f:loadBundle) in JSF.

JSF Load Bundle (f:loadBundle) Example – In this example we will demonstrate how to use Load Bundle (f:loadBundle) in JSF. We will see how to use .properties in JSF. We will retrieve values of .properties file using f:loadBundle component of JSF.