ONJava.com — Using JSF

„The JavaServer Faces (JSF) technology provides standard APIs and tag libraries needed by Java developers that build web-based user interfaces. Craig McClanahan, the author of the Apache Struts framework, co-leads the JSF project at Sun. This will ensure an easy migration from the popular Apache project to the JSF standard. Like the Struts framework, JSF defines a set of JSP tags that generate HTML form elements that can be bound to JavaBean properties. From the application developer’s perspective, the two frameworks are similar, but JSF will probably get more support from tool developers, because it is a Java standard. In the future, all J2EE application servers might actually be required to support JavaServer Faces.
Sun has recently released its Java Web Services Developer Pack 1.2, which includes a reference implementation (Early Access 4 — EA4) of the JSF Specification (Version 1.0, Public Review Draft 2). The EA4 version implements new features such as actions, managed beans, and navigation rules. This article focuses on these new features and shows how to take advantage of JSF in order to build forms, validate user input, and bind user interface components to JavaBean properties.
This article contains a web application made of four main components. A JavaBean class (PBean.java) acts as a data model, holding some text and its attributes: font, size, color, alignment, etc. A JSF-based form (edit.jsp) allows users to provide values for the properties of the JavaBean. Another Java class (PBuilder.java) generates an HTML paragraph with the given text and attributes. Finally, a JSP page (view.jsp) shows the generated paragraph.“

ONJava.com — Using JSF

ONJava.com — Using JSF

ONJava.com: Upload Files with JSF and MyFaces

„Web browsers provide an easy way for sending files to web applications, but the current versions of the Java web standards (servlets, JSP, and JSF) do not offer any help. Fortunately, there are third-party frameworks, such as Apache Commons File Upload, Apache MyFaces, and Oracle ADF Faces, that implement this feature, exposing simple APIs and custom tags. The first half of this article explains how file uploading works, walking you through the source code of MyFaces and Commons File Upload (the former uses the latter internally). It is helpful to know what happens inside of these open source frameworks in order to use them efficiently, and to be able to modify them if you have to. In the second half of the article, you’ll find a sample application that lets users upload files using their web browsers.“

ONJava.com: Upload Files with JSF and MyFaces

ONJava.com: Upload Files with JSF and MyFaces

ONJava.com — Handling Events in JavaServer Faces, Part 2

„When the user clicks a button or a link, chances are good that backend code should be asked to do something, like adding a report entry to the current report when the Add button is clicked in the sample application. Occasionally, though, an event affects only the user interface. For instance, clicking a button or changing the value of an input control may expose additional options or display more information.
As an example of user interface changes triggered either by a button click or a value change, let’s add a feature to the sample application, namely an extendable expense types list. Initially, only the most common expense types are listed, but the user can extend the list with more uncommon choices.“

ONJava.com — Handling Events in JavaServer Faces, Part 2

ONJava.com — Handling Events in JavaServer Faces, Part 2

ONJava.com — Introducing JavaServer Faces

„JavaServer Faces (JSF) has been dubbed the next big thing in Java web programming. With JSF, you use web components on your web pages and capture events caused by user actions. In the near future, Java tools will support this technology. Developing web applications will be similar to the way we write Swing applications today: dragging and dropping controls and writing event listeners. This article is an introduction to JSF. It highlights the most important aspect of JSF: JSF applications are event-driven. Also, it offers a sample JSF application that illustrates the event-driven-ness of JSF. To understand this article, you need to be familiar with servlets, JSP, JavaBeans, and custom tag libraries.“

ONJava.com — Introducing JavaServer Faces

ONJava.com — Introducing JavaServer Faces

iX 5/2006, S. 154: JSF Tutorial II

„Wie der erste Teil des JSF-Tutorials gezeigt hat, lassen sich mit Java Server Faces gut strukturierte Webanwendungen erstellen. Konzepte wie der Request-Lebenszyklus, Managed Beans, deklaratives Hinterlegen einer Navigation oder das Verwenden von Method Bindings und Value Bindings innerhalb der JSF-Seiten erleichtern dem Entwickler von Web-Anwendungen alltägliche Aufgaben. Der Vorteil liegt klar auf der Hand: Er kann sich auf das Wesentliche – die Geschäftslogik – konzentrieren.
Dieser Teil des Tutorials untersucht, ob dies auch für umfangreichere Anwendungen und die damit verbundenen komplexeren Anforderungen gilt. Thematisch im Mittelpunkt stehen Internationalisierung, Validierung und Konvertierung. Außerdem soll ein Blick über den Tellerrand hinaus zeigen, inwieweit JSF sich mit Spring und Struts – zwei im Java-Umfeld etablierten Welten – integrieren lässt. „

iX 5/2006, S. 154: JSF Tutorial II

iX 5/2006, S. 154: JSF Tutorial II

iX 4/2006, S. 136: JSF Tutorial I

„Java-basierte Web-Frameworks gibt es seit der Einführung der Servlet- und JSP-APIs wie Sand am Meer. Doch haben alle eins gemeinsam: Es sind proprietäre Lösungen. Mit der durch Sun im Jahre 2004 als Final Release veröffentlichten Spezifikation der Java Server Faces existiert zum ersten Mal ein herstellerübergreifender Standard, den dieses dreiteilige Tutorial vorstellt.

[…]

Vom Generellen zum Besonderen
Das dreiteilige Tutorial vermittelt dem Leser, wie man mit Hilfe der JSF-Technik elegant komponentenbasierte Webanwendungen entwickelt, diese in den J2EE-Kontext integriert und, durch strikte Trennung von Seitenbeschreibung und Layout, den Schritt hin zur HTML-freien Seite schafft.“

iX 4/2006, S. 136: JSF Tutorial I

iX 4/2006, S. 136: JSF Tutorial I