This article'stone or style may not reflect theencyclopedic tone used on Wikipedia. See Wikipedia'sguide to writing better articles for suggestions.(November 2012) (Learn how and when to remove this message) |
| Jakarta Faces | |
|---|---|
| Original author | Sun Microsystems |
| Developer | Eclipse Foundation |
| Stable release | 4.1.0[1] |
| Repository | |
| Written in | Java |
| Type | Web application framework |
| Website | jakarta |
Jakarta Faces, formerlyJakarta Server Faces andJavaServer Faces (JSF) is aJava specification for buildingcomponent-baseduser interfaces forweb applications.[2] It was formalized as a standard through theJava Community Process as part of theJava Platform, Enterprise Edition. It is anMVCweb framework that simplifies the construction ofuser interfaces (UI) for server-based applications by using reusable UI components in a page.[3]
JSF 2.x usesFacelets as its default templating system. Users of the software may also useXUL orJava.[4] JSF 1.x usesJavaServer Pages (JSP) as its default templating system.
This sectionneeds expansion. You can help byadding to it.(August 2013) |
In 2001, the originalJava Specification Request (JSR) for the technology that ultimately became JavaServer Faces proposed developing a package with the namejavax.servlet.ui[5]
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".[6]
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.[7]
The new JSF developments also provide wide accessibility toJava annotations such as@ManagedBean,@ManagedProperty and@FacesComponent that removes the need forfaces-config.xml, in all cases except framework extension. Navigation is also simplified, removing the need forfaces-config.xml navigation cases. Page transitions can be invoked simply by passing the name of the desired View or Facelet.[citation needed]
The addition of Partial State Saving andDocument Object Model (DOM) updates are part of the built-in standardizedAJAX support.[citation needed]
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.[citation needed]
JSF 2.0 also includes a number of other changes like adding support for events, separate development, staging, and production modes, similar toRAILS_ENV inRuby on Rails, and significantly expanding the standard set of components.[citation needed]
Based on a component-drivenUI design-model, JavaServer Faces uses XML files calledview templates orFacelets views. TheFacesServlet 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 calledstateSaving (note:transienttrue), and restored upon next creation of that view. Either the client or the server side can save objects and states.[citation needed]
| Mojarra | |
|---|---|
| Other names | JSF RI |
| Original author | Sun Microsystems |
| Developer | Eclipse Foundation |
| Initial release | March 3, 2004; 21 years ago (2004-03-03) |
| Stable release | |
| Repository | github |
| Written in | Java |
| Platform | Jakarta EE |
| Type | web framework |
| License | EPL-2.0 |
| Website | eclipse-ee4j |
JSF is often used together withAJAX, aRich 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 inMojarra (the JSFreference implementation[13]) andApache MyFaces were originally developed for HTML only, andAJAX had to be added via JavaScript. This has changed, however:
Because JSF supports multiple output formats,AJAX-enabled components can easily be added to improveuser 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.[citation needed]
JSF 2 includes support forgraceful degradation whenJavaScript is disabled in the browser.[citation needed]
The following companies and projects offer AJAX-based JSF frameworks or component libraries:
In their January 2014Technology Radar publication,ThoughtWorks wrote:[14]
We continue to see teams run into trouble using JSF – JavaServer Faces – and are recommending you avoid this technology. Teams seem to choose JSF because it is a JEE standard without really evaluating whether the programming model suits them. We think JSF is flawed because it tries to abstract awayHTML,CSS andHTTP, exactly the reverse of what modernweb frameworks do. JSF, like ASP.NET webforms, attempts to createstatefulness on top of the stateless protocol HTTP and ends up causing a whole host of problems involving shared server-side state. We are aware of the improvements in JSF 2.0, but think the model is fundamentally broken. We recommend teams use simple frameworks and embrace and understand web technologies including HTTP, HTML and CSS.
In February 2014, Çağatay Çivici (PrimeFaces Lead) responded to ThoughtWorks criticisms in a post titledJSF 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:[15]
JSF is a stateful framework by nature and state makes web applications easy to develop with. With improved state management techniques introduced in JSF 2.0+ (e.g. stateless mode, partial state saving), JSF can scale as well.
In the article published November 2014 in the DZone website, titled "Why You Should Avoid JSF", Jens Schauder wrote:[16]
Facelets, the preferred presentation technology of JSF looks at first sight like an ordinary templating technology like the good old JSP or Thymeleaf. But if you look closer the horror becomes obvious. In the same place where you structure your HTML, you also place the logic what parts of the UI should get updated on an action. A clear violation of theseparation of concerns principle in my book. Even better is the immediate attribute which changes the server side life cycle! And if this isn't enough it does it in different ways depending on what tag you use it on. You can't make stuff like this up.
In February 2016, the enterprise Java community websiteTheServerSide 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:[17]
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.
2.6 Is there a proposed package name for the API Specification? (i.e., javapi.something, org.something, etc.) [:] javax.servlet.ui
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.