RichFaces

Last updated
RichFaces
Richfaces logo.gif
Original author(s) JBoss
Stable release
4.5.17.Final [1] / June 22, 2016;5 years ago (2016-06-22)
Type Ajax, Java, JSF, Framework
License GNU Lesser General Public License
Website richfaces.jboss.org

RichFaces is an open source Ajax-enabled component library for JavaServer Faces, hosted by JBoss. It allows easy integration of Ajax capabilities into enterprise application development. It reached its end-of-life in June 2016.

Contents

RichFaces is more than just a component library for JavaServer Faces. It adds:

History

RichFaces originated from the Ajax4jsf framework which Alexander Smirnov designed and implemented. [2] In the autumn of 2005 Smirnov joined Exadel and continued to develop the framework. In March 2006 Exadel released the first version of what would become Ajax4jsf. Later in the same year, Exadel VCP was split off and the Ajax4jsf framework and RichFaces was born. While RichFaces provided out-of-the-box components (a "component-centric" Ajax approach, where components do everything you need), Ajax4jsf provided page-wide Ajax support. Developers specify which parts of the page the server should process after some client-side user actions and which parts should be updated after processing. Ajax4jsf became an open-source project hosted on java.net, while RichFaces became a commercial JSF component library.

In March 2007 JBoss (a division of Red Hat from 2006) and Exadel signed a partnership agreement whereby Ajax4jsf and RichFaces would come under the JBoss umbrella as "JBoss Ajax4jsf" and as "JBoss RichFaces". RichFaces would now also become open-source and free. In September 2007 JBoss and Exadel decided to merge Ajax4jsf and RichFaces under the RichFaces name. It made sense as both libraries were now free and open-source.[ citation needed ] Having just one product solved many existing version- and compatibility-issues, such as which version of Ajax4jsf would work with which version of RichFaces.

On February 12, 2016, the RichFaces developer Michal Petrov announced the end-of-life of RichFaces [3] for June 2016.

Framework

The framework is implemented as a component library which adds Ajax capability into existing pages, so a developer doesn't need to write any JavaScript code or to replace existing components with new Ajax widgets. RichFaces enables page-wide Ajax support instead of the traditional component-wide support. Hence, a developer can define the event on the page that invokes an Ajax request and the areas of the page that should be synchronized with the JSF Component Tree after the Ajax request changes the data on the server according to the events fired on the client.

RichFaces allows you to define (by means of JSF tags) different parts of a JSF page you wish to update with an Ajax request, and provides a few options to send Ajax requests to the server. Also the JSF page doesn't change from a "regular" JSF page and you don't need to write any JavaScript code by hand. By controlling everything from the server side, almost no JavaScript is needed and the page state can be maintained easily in the server.

RichFaces architecture

The architecture of RichFaces consists of an Ajax filter, Ajax action components, Ajax containers, and a JavaScript engine.

Ajax filter - In order get all benefits of RichFaces, a developer should register a filter in the web.xml file of the application. The filter recognizes multiple request types.
Ajax action components - AjaxCommandButton, AjaxCommandLink, AjaxPoll and AjaxSupport and other action components can be used to send Ajax requests from the client side.
Ajax containers - AjaxContainer is an interface that describes an area on a JSF page that should be decoded during an Ajax request. AjaxViewRoot and AjaxRegion are implementations of this interface.
JavaScript engine - the RichFaces JavaScript engine runs on the client-side. It updates different areas on a JSF page based on the information from the Ajax response. The JavaScript engine provides an API so developers do not need to create their own JavaScript functionality.

Skinnability

Skinnability is a special feature of RichFaces that is used for defining common interface styles. The feature is based on XCSS technology which provides flexibility and dynamics. RichFaces provides a set of predefined skins:

Skin properties, such as, generalBackgroundColor, generalLinkColor, headerFamilyFont etc. are stored in skinname.skin.properties file. Each component has a XCSS (a special file format that combines flexibility of XML and CSS) file that performs mapping of CSS selectors to the skin properties of a particular skin. Additionally, RichFaces provides skinning for standard HTML controls. You can create a custom skin using Plug-n-Skin feature, which is a Maven archetype that builds a skeleton for a new skin.

Simple JSF page with RichFaces calendar component

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999"xmlns:ui="http://java.sun.com/jsf/facelets"xmlns:h="http://java.sun.com/jsf/html"xmlns:f="http://java.sun.com/jsf/core"xmlns:a4j="http://richfaces.org/a4j"xmlns:rich="http://richfaces.org/rich"><ui:compositiontemplate="/templates/component-sample.xhtml"><a4j:outputPanelid="calendar"layout="block"><rich:calendarvalue="#{calendarBean.selectedDate}"locale="#{calendarBean.locale}"popup="#{calendarBean.popup}"showApplyButton="#{calendarBean.showApply}"cellWidth="24px"cellHeight="22px"style="width:200px"/></a4j:outputPanel></ui:composition></html>

This is the result of the presented above code

RichFacesCalendar.png

See also

Related Research Articles

Jakarta EE

Jakarta EE, formerly Java Platform, Enterprise Edition and Java 2 Platform, Enterprise Edition (J2EE), is a set of specifications, extending Java SE with specifications for enterprise features such as distributed computing and web services. Jakarta EE applications are run on reference runtimes, that can be microservices or application servers, which handle transactions, security, scalability, concurrency and management of the components it is deploying.

Jakarta Server Faces

Jakarta Server Faces is a Java specification for building component-based user interfaces for web applications and was formalized as a standard through the Java Community Process being part of the Java Platform, Enterprise Edition. It is also an MVC web framework that simplifies construction of user interfaces (UI) for server-based applications by using reusable UI components in a page.

Ajax is a set of web development techniques that uses various web technologies on the client-side to create asynchronous web applications. With Ajax, web applications can send and retrieve data from a server asynchronously without interfering with the display and behaviour of the existing page. By decoupling the data interchange layer from the presentation layer, Ajax allows web pages and, by extension, web applications, to change content dynamically without the need to reload the entire page. In practice, modern implementations commonly utilize JSON instead of XML.

In computing, Oracle Application Development Framework, usually called Oracle ADF, provides a Java framework for building enterprise applications. It provides visual and declarative approaches to Java EE development. It supports rapid application development based on ready-to-use design patterns, metadata-driven and visual tools.

Apache Wicket, commonly referred to as Wicket, is a component-based web application framework for the Java programming language conceptually similar to JavaServer Faces and Tapestry. It was originally written by Jonathan Locke in April 2004. Version 1.0 was released in June 2005. It graduated into an Apache top-level project in June 2007.

Apache Tapestry

Apache Tapestry is an open-source component-oriented Java web application framework conceptually similar to JavaServer Faces and Apache Wicket. Tapestry was created by Howard Lewis Ship, and was adopted by the Apache Software Foundation as a top-level project in 2006.

A web framework (WF) or web application framework (WAF) is a software framework that is designed to support the development of web applications including web services, web resources, and web APIs. Web frameworks provide a standard way to build and deploy web applications on the World Wide Web. Web frameworks aim to automate the overhead associated with common activities performed in web development. For example, many web frameworks provide libraries for database access, templating frameworks, and session management, and they often promote code reuse. Although they often target development of dynamic web sites, they are also applicable to static websites.

The Java Portlet Specification defines a contract between the portlet container and portlets and provides a convenient programming model for Java portlet developers.

Echo is a web application framework created by the company NextApp. The latest iteration, Echo3, allows writing applications in either server-side Java or client-side JavaScript. Server-side applications do not require developer knowledge of HTML, HTTP, or JavaScript. Client-side JavaScript-based applications do not require a server, but can communicate with one via AJAX.

JBoss Seam

Seam was a web application framework developed by JBoss, a division of Red Hat.

ICEfaces is an open-source Software development kit that extends JavaServer Faces (JSF) by employing Ajax. It is used to construct rich Internet applications (RIA) using the Java programming language. With ICEfaces, the coding for interaction and Ajax on the client side is programmed in Java, rather than in JavaScript, or with plug-ins.

JBoss Tools is a set of Eclipse plugins and features designed to help JBoss and JavaEE developers develop applications. It is an umbrella project for the JBoss developed plugins that will make it into JBoss Developer Studio.

JBoss Developer Studio (JBDS) is a development environment created and currently developed by JBoss and Exadel.

Ajax4jsf was a project for an open source framework that added Ajax capabilities to the JavaServer Faces (JSF) web application framework.

In computing, Facelets is an open-source Web template system under the Apache license and the default view handler technology for Jakarta Server Faces. The language requires valid input XML documents to work. Facelets supports all of the JSF UI components and focuses completely on building the JSF component tree, reflecting the view for a JSF application.

Apache Click is a page and component oriented web application framework for the Java language and is built on top of the Java Servlet API.

ZK is an open-source Ajax Web application framework, written in Java, that enables creation of graphical user interfaces for Web applications with little required programming knowledge.

Jspx-bay

jspx-bay, commonly referred to as jspx, is a free open source pure Java web RAD framework. Jspx should not be confused with other technologies using the same name like Oracle Application Framework and XML JSP.

The JBoss Enterprise Application Platform is a subscription-based/open-source Java EE-based application server runtime platform used for building, deploying, and hosting highly-transactional Java applications and services developed and maintained by Red Hat. The JBoss Enterprise Application Platform is part of Red Hat's Enterprise Middleware portfolio of software. Because it is Java-based, the JBoss application server operates across platforms; it is usable on any operating system that supports Java. JBoss Enterprise Application Platform was originally called JBoss and was developed by the eponymous company JBoss, acquired by Red Hat in 2006

References

  1. "Stable Downloads - JBoss Community".
  2. Max Katz, Exadel (August 15, 2008). "Ajax4jsf and RichFaces - historical perspective". Archived from the original on February 2, 2009.
  3. Michal Petrov (2016-02-12). "The future of RichFaces".