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:

Créer un Blog avec JBoss Seam, Hibernate JPA et JSF puis Déploiment sur Tomcat dans le Cloud – Partie III

Seam Tomcat Deployment

In this part III of the tutorial, we’ll build the entity classes from the database we created in Part I and configure the Seam project we created in Part II so as to make it fully compatible with Apache Tomcat.

Creating The Model Layer

We’ll use Hibernate‘s reverse engineering tool (hbm2java) embedded in Seam-gen to create the entity classes from the database we created in part 1.

Seam Generate Entities

Figure 3.1 - Generating entities from database in JBoss Seam

Right-click the project blog in project explorer and select New > Seam Generate Entities.

Continue reading

Créer un Blog avec JBoss Seam, Hibernate JPA et JSF puis Déploiment sur Tomcat dans le Cloud – Partie I

Tired of simple hello world tutorials? Here’s an intermediate-level tutorial in which we’re going to make a blog cms application using JBoss Seam incorporating JSF 1.2 + Facelets, Hibernate JPA 1.0 and we’ll deploy it to Tomcat.

Best 5 Java web application frameworks

JSF

Some programmers think JSF has a steep learning curve

When it comes to developing web applications using Java, writing all the code from scratch has its advantages if you’re trying to master a new technology, but for real life web applications, you have to go for a framework as many expert developers would agree. Otherwise you risk a great deal of failure because of having allocated too much time and too many resources by re-inventing the wheels.

[adsenseyu1]

There are some hardliners who still argue why there’s ever a need for a framework, since everything can be accomplished by Servlets, JSP and Filters. One of them is Bear Bibeault author of JQuery in Action.

-Adeel Ansari

The cost is an important factor—although « free » in most cases also means widespread usage, community support, and no dependence on a single vendor. It takes some time for developers to get used to a framework and be good at it. Therefore choosing a framework as a long-term strategy. You cannot be switching frameworks for every project. Sticking with one framework also helps as once the expertise in that framework builds up; customizing the framework also becomes a possibility.

A tempting option is for organizations to build their own framework to address needs specific to the kind of work the organization undertakes. Although it does seam seem to make sense on paper, for my money, this is a suicidal strategy. Thoroughly testing and maintaining a framework is a huge task that will need dedicated human resources. These few people would become critical and the only source of support for others using that framework. Also, with so many quality frameworks available for free, I seriously doubt it really is necessary.

As with many web frameworks emerging nowadays, the ever-increasing number of Java web application frameworks out there today is intimidating for many developers even to look into because of being presented with too many choices. However, matching the criteria of popularity, widespread usage and tooling support, I can list a few of the best Java web application frameworks here and in a descending order of my personal choice. Sorry if I haven’t listed your favorite Java web framework here, feel free to agree or disagree in the comments section.

  1. Struts (2)
  2. Wicket
  3. Spring
  4. JSF
  5. Seam

[adsenseyu1]

Struts 2

Struts 1.x was the first most popular and widely accepted web framework for Java, because of the way it handled the MVC model 2 paradigm and its action-based architecture. It was an elegant framework that handled the flow of application and a lot of other routine tasks. Another advantage of using Struts was an incredibly growing number of developers preferred it as a de-facto J2EE standard. Many of the popular Java IDEs also provided tools for Struts development, making life even easier for the programmers. Even today IDEs like NetBeans and JBoss Developer Studio have built-in support for Struts 1.

JSF

Some programmers think JSF has a steep learning curve

When it comes to developing web applications using Java, writing all the code from scratch has its advantages if you’re trying to master a new technology, but for real life web applications, you have to go for a framework as many expert developers would agree. Otherwise you risk a great deal of failure because of having allocated too much time and too many resources by re-inventing the wheels.

[adsenseyu1]

There are some hardliners who still argue why there’s ever a need for a framework, since everything can be accomplished by Servlets, JSP and Filters. One of them is Bear Bibeault author of JQuery in Action.

-Adeel Ansari

The cost is an important factor—although « free » in most cases also means widespread usage, community support, and no dependence on a single vendor. It takes some time for developers to get used to a framework and be good at it. Therefore choosing a framework as a long-term strategy. You cannot be switching frameworks for every project. Sticking with one framework also helps as once the expertise in that framework builds up; customizing the framework also becomes a possibility.

A tempting option is for organizations to build their own framework to address needs specific to the kind of work the organization undertakes. Although it does seam seem to make sense on paper, for my money, this is a suicidal strategy. Thoroughly testing and maintaining a framework is a huge task that will need dedicated human resources. These few people would become critical and the only source of support for others using that framework. Also, with so many quality frameworks available for free, I seriously doubt it really is necessary.

As with many web frameworks emerging nowadays, the ever-increasing number of Java web application frameworks out there today is intimidating for many developers even to look into because of being presented with too many choices. However, matching the criteria of popularity, widespread usage and tooling support, I can list a few of the best Java web application frameworks here and in a descending order of my personal choice. Sorry if I haven’t listed your favorite Java web framework here, feel free to agree or disagree in the comments section.

  1. Struts (2)
  2. Wicket
  3. Spring
  4. JSF
  5. Seam

[adsenseyu1]

Struts 2

Struts 1.x was the first most popular and widely accepted web framework for Java, because of the way it handled the MVC model 2 paradigm and its action-based architecture. It was an elegant framework that handled the flow of application and a lot of other routine tasks. Another advantage of using Struts was an incredibly growing number of developers preferred it as a de-facto J2EE standard. Many of the popular Java IDEs also provided tools for Struts development, making life even easier for the programmers. Even today IDEs like NetBeans and JBoss Developer Studio have built-in support for Struts 1.
Spring MVC
Struts (1 & 2)
Wicket
JSF
Seam

Matrix des plates-formes compatibles et des éditeurs intégraux avec des outils JBoss

JBoss Tools Icon

JBoss Tools Compatibility Matrix

EclipseJBoss ToolsJBDSJBoss EAPJBoss AS (Community)SeamJSFRichFaces
3.6 / Helios3.23.0.04.3,5.0,5.15.1, 5.0, 4.2, 4.0, 3.22.2, 2.1, 2.0, 1.22.0 (in VPE), 1.2, 1.13.3.x
3.5/Galileo3.1.03.0.04.3, 5.05.1, 5.0, 4.2, 4.0, 3.22.2, 2.1, 2.0, 1.22.0 (in VPE), 1.2, 1.13.3.x
3.4.2/Ganymede3.0.x2.1.04.3, 5.05.0, 4.2, 4.0, 3.22.2, 2.1, 2.0, 1.21.2, 1.13.3.1
3.3.2/Europa2.1.21.1.04.35.0, 4.2, 4.0, 3.22.0, 1.21.2, 1.13.3.0
3.3.1.1/Europa2.0.11.0.04.24.2, 4.0, 3.22.0, 1.21.2, 1.13.1.0
Continue reading