Un Tutoriel Simple de JSF avec PrimeFaces et le Traitement des objets JSON en Java

The following tutorial is an example of parsing JSON objects 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

The following tutorial is an example of parsing JSON objects 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

[adsenseyu1]

Bu yazımda döviz kurları bilgi akışı içeren bir JSON nesnesini işleyip, bir web sayfası üzerinde JSF 2.1 framework’ü ve JSF için bir zengin bileşen kütüphanesi olan PrimeFaces 2.2 kullanarak AJAX ve Web 2.0 özellikleri ile nasıl görünteleyebileceğimizi göreceğiz.

Bu öğretiyi uygulamak için nelere ihtiyacınız var

  • Oracle JDK 1.6 veya sonraki bir sürümü
  • Netbeans 7.0 veya daha yeni bir sürümü (farklı bir editör ve geliştirme ortamı kullanmayı tercih ederseniz, Gerekli kütüphane ve bileşenlerin tümünü manuel olarak projeye dahil etmeniz gerekebilir. Bkz. sonraki bölüm)
  • Tomcat 7

Kullanılan teknoloji ve kütüphaneler

  • JSF 2.1 (Mojarra 2 kütüphaneleri yani jsf-api.jar, jsf-impl.jar, jstl.jar ve standard.jar)
  • PrimeFaces 2.2.1
  • JSON (Java için)
  • commons-logging-1.1.1.jar
  • log4j-1.2.16.jar
  • httpcore-4.1.4.jar
  • httpclient-4.1.3.jar

Projeyi JSF 2 ve PrimeFaces desteği dahil olacak şekilde hazırlama

Netbeans’i açın ve aşağıdaki adımları sırayla izleyin:

Be Sociable, Share!

11 thoughts on “Un Tutoriel Simple de JSF avec PrimeFaces et le Traitement des objets JSON en Java

    • A Managed Bean is instantiated as soon as a JSF action references a method contained in it, in the case of the ExchangeRatesBean, it’s invoked as index.xhtml is called in the browser.

    • Sure. The main strategy here is pulling the exchange rate data once and providing that very data to all visitors (until someone invokes the Refresh action, which will benefit every new visitor) as there’s a very very little chance that there would be dramatic changes in the rates. You could change to scope of the managed bean to “session” (i.e. @SessionScoped) or even lower the scope as low as to the “request” (@RequestScoped) but I didn’t want to add extra load to the service (data) provider for a free service and therefore chose to avoid pissing them off.

  1. Primefaces action commands does not function on cloudbees, though it is all wirk on local machine with the same server version. What could cause to this?

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *


*

Vous pouvez utiliser ces balises et attributs HTML : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="">