A Simple JSF Tutorial with PrimeFaces and JSON Object Parsing in Java

In this tutorial, you will see an example of parsing JSON objects containing exchange rates for certain currencies and displaying them on a web page using JSF 2.1 and PrimeFaces 2.2 which is a rich-component framework for JSF adding AJAX and Web 2.0 capabilities to your web application.

What you need for this tutorial

  • Oracle JDK 1.6 or later
  • Netbeans 7.0 or later (if you choose a different IDE, you will need to manually get the necessary libraries and components for this tutorial. See the following section)
  • Tomcat 7

Technologies and libraries used

  • JSF 2.1 (Mojarra 2 libraries a.k.a. jsf-api.jar, jsf-impl.jar, jstl.jar and standard.jar)
  • PrimeFaces 2.2.1
  • JSON (for Java)
  • commons-logging-1.1.1.jar
  • log4j-1.2.16.jar
  • httpcore-4.1.4.jar
  • httpclient-4.1.3.jar

Setting up the Project with JSF 2 and PrimeFaces Support

Launch Netbeans, and then go along the following steps:
Continue reading