JavaServer Faces
   HOME

TheInfoList



OR:

Jakarta Faces, formerly Jakarta Server Faces and JavaServer Faces (JSF) is a
Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mos ...
specification for building
component Circuit Component may refer to: •Are devices that perform functions when they are connected in a circuit.   In engineering, science, and technology Generic systems * System components, an entity with discrete structure, such as an assem ...
-based
user interface In the industrial design field of human–computer interaction, a user interface (UI) is the space where interactions between humans and machines occur. The goal of this interaction is to allow effective operation and control of the machine f ...
s for
web application A web application (or web app) is application software that is accessed using a web browser. Web applications are delivered on the World Wide Web to users with an active network connection. History In earlier computing models like client-serv ...
s and was formalized as a standard through the
Java Community Process The Java Community Process (JCP), established in 1998, is a formalized mechanism that allows interested parties to develop standard technical specifications for Java technology. Anyone can become a JCP Member by filling a form available at thJCP w ...
being part of the
Java Platform, Enterprise Edition Jakarta EE, formerly Java Platform, Enterprise Edition (Java EE) 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 ser ...
. It is also an
MVC MVC may refer to: Science and technology * Maximum-value composite procedure, an imaging procedure * Multivariable calculus, a concept in mathematics * Multivariable control, a concept in process engineering * Mechanical vapor compression, a desal ...
web framework 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 ...
that simplifies the construction of
user interface In the industrial design field of human–computer interaction, a user interface (UI) is the space where interactions between humans and machines occur. The goal of this interaction is to allow effective operation and control of the machine f ...
s (UI) for server-based applications by using reusable UI components in a page. JSF 2.x uses
Facelets In computing, Facelets is an open-source Web template system under the Apache license and the default view handler technology (aka view declaration language) for Jakarta Server Faces (JSF; formerly JavaServer Faces). The language requires val ...
as its default templating system. Users of the software may also choose to employ technologies such as
XUL XUL ( ), which stands for XML User Interface Language, is a user interface markup language developed by Mozilla. XUL is an XML dialect for writing graphical user interfaces, enabling developers to write user interface elements in a manner sim ...
, or
Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mos ...
. JSF 1.x uses
JavaServer Pages Jakarta Server Pages (JSP; formerly JavaServer Pages) is a collection of technologies that helps software developers create dynamically generated web pages based on HTML, XML, SOAP, or other document types. Released in 1999 by Sun Microsystems, J ...
(JSP) as its default templating system.


History

In 2001, the original
Java Specification Request The Java Community Process (JCP), established in 1998, is a formalized mechanism that allows interested parties to develop standard technical specifications for Java technology. Anyone can become a JCP Member by filling a form available at thJCP w ...
(JSR) for the technology that ultimately became JavaServer Faces proposed developing a package with the name javax.servlet.ui In June 2001, ''
JavaWorld ''InfoWorld'' (abbreviated IW) is an information technology media business. Founded in 1978, it began as a monthly magazine. In 2007, it transitioned to a web-only publication. Its parent company today is International Data Group, and its siste ...
'' 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".


Latest developments

Facelets In computing, Facelets is an open-source Web template system under the Apache license and the default view handler technology (aka view declaration language) for Jakarta Server Faces (JSF; formerly JavaServer Faces). The language requires val ...
(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. The new JSF developments also provide wide accessibility to
Java annotation In the Java computer programming language, an annotation is a form of syntactic metadata that can be added to Java source code. Classes, methods, variables, parameters and Java packages may be annotated. Like Javadoc tags, Java annotations can b ...
s 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 Ajax may refer to: Greek mythology and tragedy * Ajax the Great, a Greek mythological hero, son of King Telamon and Periboea * Ajax the Lesser, a Greek mythological hero, son of Oileus, the king of Locris * ''Ajax'' (play), by the ancient Gree ...
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 Ruby on Rails (simplified as Rails) is a server-side web application framework written in Ruby under the MIT License. Rails is a model–view–controller (MVC) framework, providing default structures for a database, a web service, and we ...
, and significantly expanding the standard set of components.


Update history

* JSF 2.3 (2017-03-28) – Major features: search Expressions, extensionless URLs, bean validation for complete classes, push communication using
WebSocket WebSocket is a computer communications protocol, providing full-duplex communication channels over a single TCP connection. The WebSocket protocol was standardized by the IETF as in 2011. The current API specification allowing web applications ...
, enhanced integration with CDI. * JSF 2.2 (2013-05-21) – Introduced new concepts like stateless views, page flow and the ability to create portable resource contracts. * JSF 2.1 (2010-11-22) – Maintenance release 2 of JSF 2.0. Only a very minor number of specification changes. * JSF 2.0 (2009-07-01) – Major release for ease of use, enhanced functionality, and performance. Coincides with
Java EE Jakarta EE, formerly Java Platform, Enterprise Edition (Java EE) 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 ser ...
6. * JSF 1.2 (2006-05-11) – Many improvements to core systems and APIs. Coincides with
Java EE Jakarta EE, formerly Java Platform, Enterprise Edition (Java EE) 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 ser ...
5. Initial adoption into Java EE. * JSF 1.1 (2004-05-27) – Bug-fix release. No specification changes. * JSF 1.0 (2004-03-11) – Initial specification released.


How it works

Based on a component-driven UI design-model, JavaServer Faces uses XML files called view templates or
Facelets In computing, Facelets is an open-source Web template system under the Apache license and the default view handler technology (aka view declaration language) for Jakarta Server Faces (JSF; formerly JavaServer Faces). The language requires val ...
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

JSF is often used together with
AJAX Ajax may refer to: Greek mythology and tragedy * Ajax the Great, a Greek mythological hero, son of King Telamon and Periboea * Ajax the Lesser, a Greek mythological hero, son of Oileus, the king of Locris * ''Ajax'' (play), by the ancient Gree ...
, a
Rich Internet application A rich web application (originally called a rich Internet application, or RIA or installable Internet application) is a web application that has many of the characteristics of desktop application software. The concept is closely related to a sing ...
development technique.
AJAX Ajax may refer to: Greek mythology and tragedy * Ajax the Great, a Greek mythological hero, son of King Telamon and Periboea * Ajax the Lesser, a Greek mythological hero, son of Oileus, the king of Locris * ''Ajax'' (play), by the ancient Gree ...
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 mojarras are a family, Gerreidae, of fish in the order Perciformes. The family includes about 53 species found worldwide in tropical and warm temperate regions. They mostly inhabit coastal salt and brackish waters, although some occur in fr ...
(the JSF
reference implementation In the software development process, a reference implementation (or, less frequently, sample implementation or model implementation) is a program that implements all requirements from a corresponding specification. The reference implementation o ...
) and
Apache MyFaces Apache MyFaces is an Apache Software Foundation project that creates and maintains an open-source JavaServer Faces implementation, along with several libraries of JSF components that can be deployed on the core implementation. The project is div ...
were originally developed for HTML only, and
AJAX Ajax may refer to: Greek mythology and tragedy * Ajax the Great, a Greek mythological hero, son of King Telamon and Periboea * Ajax the Lesser, a Greek mythological hero, son of Oileus, the king of Locris * ''Ajax'' (play), by the ancient Gree ...
had to be added via JavaScript. This has changed, however: Because JSF supports multiple output formats,
AJAX Ajax may refer to: Greek mythology and tragedy * Ajax the Great, a Greek mythological hero, son of King Telamon and Periboea * Ajax the Lesser, a Greek mythological hero, son of Oileus, the king of Locris * ''Ajax'' (play), by the ancient Gree ...
-enabled components can easily be added to improve
user interface In the industrial design field of human–computer interaction, a user interface (UI) is the space where interactions between humans and machines occur. The goal of this interaction is to allow effective operation and control of the machine f ...
s 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 Fault tolerance is the property that enables a system to continue operating properly in the event of the failure of one or more faults within some of its components. If its operating quality decreases at all, the decrease is proportional to the ...
when
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of websites use JavaScript on the client side for webpage behavior, of ...
is disabled in the browser.


AJAX-enabled components and frameworks

The following companies and projects offer AJAX-based JSF frameworks or component libraries: *
Apache MyFaces Apache MyFaces is an Apache Software Foundation project that creates and maintains an open-source JavaServer Faces implementation, along with several libraries of JSF components that can be deployed on the core implementation. The project is div ...
– The
Apache Foundation The Apache Software Foundation (ASF) is an American nonprofit corporation (classified as a 501(c)(3) organization in the United States) to support a number of open source software projects. The ASF was formed from a group of developers of the ...
JSF implementation with AJAX components * Backbase ''Enterprise AJAX – JSF Edition'' –
AJAX framework Ajax may refer to: Greek mythology and tragedy * Ajax the Great, a Greek mythological hero, son of King Telamon and Periboea * Ajax the Lesser, a Greek mythological hero, son of Oileus, the king of Locris * ''Ajax'' (play), by the ancient Greek ...
* BootsFaces ''Open source JSF Framework based on Bootstrap'' *
IBM Notes HCL Notes (formerly IBM Notes and Lotus Notes; see Branding below) and HCL Domino (formerly IBM Domino and Lotus Domino) are the client and server, respectively, of a collaborative client-server software platform formerly sold by IBM, now by HC ...
XPages XPages is an IBM implementation of JavaServer Faces with a server side JavaScript runtime and the built-in NoSQL database IBM Domino. It allows data from IBM Notes and Relational Databases to be displayed to browser clients on all platforms. Th ...
* ICEfaces – open-source, Java JSF extension framework and
rich Rich may refer to: Common uses * Rich, an entity possessing wealth * Rich, an intense flavor, color, sound, texture, or feeling **Rich (wine), a descriptor in wine tasting Places United States * Rich, Mississippi, an unincorporated commun ...
components, AJAX without JavaScript *
JBoss WildFly, formerly known as JBoss AS, or simply JBoss, is an application server written by JBoss, now developed by Red Hat. WildFly is written in Java and implements the Java Platform, Enterprise Edition (Java EE) specification. It runs on mul ...
''
RichFaces 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. RichFaces is m ...
'' (derived from and replaces '' AJAX4jsf'') – AJAX-enabled JSF components for layout, file upload, forms, inputs and many other features. It reached its end-of-life in June 2016. * OmniFaces – open-source JSF utility library
OpenFaces
– AJAX framework with JSF components * Oracle ''ADF Faces Rich Client'' –
Oracle Application Development Framework 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 ...
* PrimeFaces – AJAX framework with JSF components *
Sun The Sun is the star at the center of the Solar System. It is a nearly perfect ball of hot plasma, heated to incandescence by nuclear fusion reactions in its core. The Sun radiates this energy mainly as light, ultraviolet, and infrared radi ...
Java BluePrints AJAX components * ZK – AJAX framework with JSF components


Criticisms


ThoughtWorks, 2014

In their January 2014 ''Technology Radar'' publication, ThoughtWorks wrote:


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:


DZone, 2014

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


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: # Simple tasks become difficult; # JSF lacks flexibility; # The learning curve is steep; # Incompatibility with standard Java technologies; and # Primitive AJAX support.


References


External links

* {{Authority control Java enterprise platform Java specification requests