Jakarta Faces Explained

Jakarta Faces
Jakarta Faces
Author:Sun Microsystems
Developer:Eclipse Foundation
Programming Language:Java
Genre:Web application framework

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

JSF 2.x uses Facelets as its default templating system. Users of the software may also use XUL or Java.[3] JSF 1.x uses JavaServer Pages (JSP) as its default templating system.

History

In 2001, the original Java Specification Request (JSR) for the technology that ultimately became JavaServer Faces proposed developing a package with the name javax.servlet.ui[4]

In June 2001, JavaWorld would report on Amy Fowler's team's design of "the JavaServer Faces API" (also known as "Moonwalk") as "an application framework for creating Web-based user interfaces".[5]

Developments

Facelets (which was designed specifically for Java Server Faces) was adopted as the official view technology for JSF 2.0. This eliminates the life-cycle conflicts that existed with JSP, forcing workarounds by Java developers.[6]

The new JSF developments also provide wide accessibility to Java annotations such as @ManagedBean, @ManagedProperty and @FacesComponent that removes the need for faces-config.xml, in all cases except framework extension. Navigation is also simplified, removing the need for faces-config.xml navigation cases. Page transitions can be invoked simply by passing the name of the desired View or Facelet.

The addition of Partial State Saving and Document Object Model (DOM) updates are part of the built-in standardized AJAX support.

The latest JSF release has built-in support for handling resources like images, CSS and Javascript, allowing artifacts to be included with component libraries, separated into JAR files, or simply co-located into a consistent place within the Web application. This includes logical naming and versioning of resources.

JSF 2.0 also includes a number of other changes like adding support for events, separate development, staging, and production modes, similar to RAILS_ENV in Ruby on Rails, and significantly expanding the standard set of components.

Update history

How it works

Based on a component-driven UI design-model, JavaServer Faces uses XML files called view templates or Facelets views. The FacesServlet processes requests, loads the appropriate view template, builds a component tree, processes events, and renders the response (typically in the HTML language) to the client. The state of UI components and other objects of scope interest is saved at the end of each request in a process called stateSaving (note: transient true), and restored upon next creation of that view. Either the client or the server side can save objects and states.

JSF and AJAX

Mojarra
Other Names:JSF RI
Author:Sun Microsystems
Developer:Eclipse Foundation
Latest Release Version:3.0.2
Programming Language:Java
Engines:-->
Platform:Jakarta EE
Genre:web framework
License:EPL-2.0

JSF is often used together with AJAX, a Rich Internet application development technique. AJAX is a combination of web development techniques and technologies that make it possible to create rich user interfaces. The user interface components in Mojarra (the JSF reference implementation[11]) and Apache MyFaces were originally developed for HTML only, and AJAX had to be added via JavaScript. This has changed, however:

Because JSF supports multiple output formats, AJAX-enabled components can easily be added to improve user interfaces created with JSF. The JSF 2.0 specification provides built-in support for AJAX by standardizing the AJAX request lifecycle and providing simple development interfaces to AJAX events. The specification allows an event triggered by the client to go through validation, conversion, and method invocation, before returning the result to the browser via an XML DOM update.

JSF 2 includes support for graceful degradation when JavaScript is disabled in the browser.

AJAX-enabled components and frameworks

The following companies and projects offer AJAX-based JSF frameworks or component libraries:

Criticisms

ThoughtWorks, 2014

In their January 2014 Technology Radar publication, ThoughtWorks wrote:[12]

Rebuttal

In February 2014, Çağatay Çivici (PrimeFaces Lead) responded to ThoughtWorks criticisms in a post titled JSF is not what you've been told anymore. Çivici argues that improvements in JSF over the years offer many features that embrace modern web development, providing the option to write your own JavaScript, HTML, and CSS. Also regarding state, Çivici wrote:[13]

DZone, 2014

In the article published November 2014 in the DZone website, titled "Why You Should Avoid JSF", Jens Schauder wrote:[14]

TheServerSide, 2016

In February 2016, the enterprise Java community website TheServerSide published an article recommending against the use of JSF, whose use could compromise the quality of the final product. The article ellaborated on five reasons:[15]

  1. Simple tasks become difficult;
  2. JSF lacks flexibility;
  3. The learning curve is steep;
  4. Incompatibility with standard Java technologies; and
  5. Primitive AJAX support.

Notes and References

  1. https://jakarta.ee/specifications/faces/4.0/ Jakarta Faces 4.0
  2. Web site: JSF 2.0 Tutorial . mkyong . 2010-12-12 . 2017-04-28 . JavaServer Faces (JSF) 2.0, is an MVC web framework which focus on simplifies building user interfaces (comes with 100+ ready UI tags) for Java web application and make reusable UI component easy to implement..
  3. https://rogerkeays.com/novdl-write-your-jsf-views-in-pure-java NoVDL: Write your JSF views in pure Java
  4. Web site: JSR 127: JavaServer Faces . 2014 . Java Community process . Oracle Corporation . 2014-08-05 . 2.6 Is there a proposed package name for the API Specification? (i.e., javapi.something, org.something, etc.) [:] javax.servlet.ui.
  5. News: Armstrong . Eric . 2001-06-06 . mdy . Java Web services: What's not to like? . . 2020-07-27 . The JavaServer Faces API (aka Moonwalk) promises to provide an elegant solution for implementing interactive functionality on incompatible browsers. [...] Designed by a team led by Amy Fowler, Sun's AWT and Swing architect, the JavaServer Faces API will provide a collection of GUI tools that will run on common browsers using standard HTML..
  6. Web site: Bergsten. Hans. Improving JSF by dumping JSP. O'Reilly. 18 August 2011.
  7. Web site: Tijms . Arjan . What's new in JSF 2.3? . Musings of a Java EE developer . 2020-07-27.
  8. https://blog.oio.de/2013/04/16/jsf-2-2-jsr-344-is-final/ JSF 2.2 (JSR-344) is final |techscouting through the java news
  9. https://blog.oio.de/2010/11/24/jsr-000314-javaservertm-faces-2-1/ JSR 314 JavaServer Faces 2.1 JSF 2.1 |techscouting through the java news
  10. Web site: Was ist neu in JSF 2.1 . Bosch . Andy . 2010-11-29 . it-republik.de . 2013-02-19 . de.
  11. Web site: Lubke . Ryan . 2007-12-05 . dmy . Project Mojarra - the JSF RI gets a code name . Ryan Lubke's Blog . . . https://web.archive.org/web/20170407234739/https://blogs.oracle.com/rlubke/entry/project_mojarra_the_jsf_ri . 2017-04-07.
  12. Web site: Technology Radar . ThoughtWorks . January 2014 . 12 . 2014-01-30 . https://web.archive.org/web/20160407102412/http://thoughtworks.fileburst.com/assets/technology-radar-jan-2014-en.pdf . 2016-04-07 . dead .
  13. Web site: 2014-02-12. JSF is not what you've been told anymore. 2020-11-24. PrimeFaces. en-US.
  14. Web site: Jens Schauder. Why You Should Avoid JSF . DZone . November 2014.
  15. Web site: Five drawbacks to choosing JSF as your web application framework . McKenzie . Cameron . TheServerSide . February 16, 2016 . December 22, 2020.