JavaServer Faces

JavaServer Faces

JavaServer Faces (JSF) is a Java-based Web application framework intended to simplify development of user interfaces for Java EE applications. Unlike other traditional request-driven MVC web frameworks, JSF uses a component-based approach. The state of UI components is saved when the client requests a new page and then is restored when the request is returned. Out of the box, JSF uses JavaServer Pages (JSP) for its display technology, but JSF can also accommodate other display technologies (such as XUL). JSF includes:
* A set of APIs for representing user interface (UI) components and managing their state, handling events and input validation, converting values, defining page navigation, and supporting internationalization and accessibility
* A default set of UI components
* Two JavaServer Pages (JSP) custom tag libraries for expressing a JavaServer Faces interface within a JSP page.
* A server-side event model
* State management
* Managed Beans (JavaBeans created with dependency injection)
* Unified Expression Language for both JSP 2.0 and JSF 1.2The JSF specification was developed under the Java Community Process as "JSR 127", which defined JSF 1.0 and 1.1, and "JSR 252" which defined JSF 1.2. Upcoming JSF 2.0 is being developed as JSR 314.

JSF versions

* JSF 1.0 (2004-03-11) — the initial release of the JSF specification.
* JSF 1.1 (2004-05-27) — bug fix release. There were no spec or HTML renderkit changes.
* JSF 1.2 (2006-05-11) — latest release.
** provide XML Schema for the config files, instead of using DTD
** enhancements to allow faces applications to handle multi-frame, or multi-window UI designs
** enhancements to the f: tag library for improved TCK coverage, f:view lifetime events, and other small features
** enhancements to the decorator support for API objects
** security enhancements for client side state saving
** solve the "duplicate button press" problem (pressing a button twice to cause 2 submissions)
** re-organize the spec into normative, and non-normative sections, to make implementation easier
** portlet related bug-fixes
** bug fixes that require minimal specification changes
* JSF 2.0 (expected in 2008) - major revision of the specification under development. Planned to coincide with Java EE 6.

JSF and Ajax

JSF is often mentioned together with Ajax, a Rich Internet application technology. Ajax is a combination of technologies that makes it possible to create richer user interfaces. The user interface components in the JSF reference implementation and MyFaces were originally developed in HTML. Because JSF supports multiple output formats, Ajax-enabled components can easily be added to improve the quality of JSF-based user interfaces. The JSF 2.0 specification intends to improve support for Ajax by allowing UI logic to run partly on the client and not only on the server, and by providing support for graceful degradation when JavaScript is disabled in the browser.

Ajax-enabled JSF components and frameworks

The following companies and projects offer Ajax-based JSF implementations or blueprints:
* ADF Faces "ADF Faces Rich Client", [http://www.oracle.com/technology/products/adf/adffaces/index.html (ADF Faces site)]
* Backbase "Enterprise Ajax — JSF Edition", Ajax framework
* ICEfaces, open-source, Java JSF extension framework and rich components, Ajax without JavaScript
* jBoss "RichFaces" and "Ajax4JSF", Ajax-enabled JSF Components
* MyFaces, JSF Implementation with Ajax Components
* [http://www.infragistics.com/java/netadvantage/jsf.aspx#NewFeatures NetAdvantage forJSF] AJAX enabled JSF components, Portal support, etc. [http://www.infragistics.com Infragistics]
* Sun "Java BluePrints AJAX Components" ( [https://blueprints.dev.java.net/ajaxcomponents.html website] )
* MB Technologies "BindowsFaces" [http://www.bindows.net/BindowsFaces/ (BindowsFaces site)]
* ZK Ajax framework with JSF components [http://www.zkoss.org/release/zkjsfcomps-rn-1.0.0.dsp (ZK JSF site)]
* J4Fry Ajax JSF Solution [http://www.j4fry.org/ (J4Fry Open Source Community site)]

Comparison to other Web-GUI Frameworks

truts

Struts is a popular Model 2 MVC framework from the Apache Software Foundation. It provides page-at-a-time MVC and does not have a component model in the style of JSF. Pages are mapped to models with a dispatch servlet (controller) piping input to actions. Struts applications use JSPs to render views and are amenable to mix-and-match jsp taglib use. (See also Apache Beehive)

WebObjects / Wotonomy

WebObjects is the earliest known web-application framework and was originally developed by NeXT Software, Inc. then acquired by Apple Computer when it acquired NeXT. It contains an MVC architecture with a component and event model and lifecycle similar to JSF. It is deployable without J2EE (its original configuration), or can be deployed in a servlet container — its dispatcher object acting as the entry-point of a J2EE web application. Unlike JSF's default case, components are not defined in JSP files but are in .wo directories containing any or all of html/xml/wml template files, a .wod file to map fields and actions to Java code, and a .java class. A template file provides the rendering/layout and may include other WebObjects components, rather than the delegated RenderKit approach used by default in JSF. It is a halfway-point between the delegated and directly-rendered approaches used in JSF.

WebObjects also includes a layered architecture with one of the earliest Object-Relational Mapping frameworks, Enterprise Objects Framework.

Wotonomy is a clean-room, open-source re-implementation of the WebObjects frameworks licensed under LGPL. It attempts to implement all parts of WebObjects, and has implemented the whole MVC web-GUI stack. As a clone of WebObjects, it differs from JSF in identical ways, except where it is incomplete.

Apache Tapestry

Tapestry is an open-source framework for creating dynamic, robust, scalable web applications in Java. Tapestry builds upon the standard Java Servlet API, and so it works in any servlet container or application server. Unlike JSF, Tapestry does not use JSP as the default view technology — instead preferring an alternate templating engine that allows for easy html preview and editing (similar to the JSF-based Facelets).

Microsoft ASP.Net

JSF features a component based approach to WebApplication development similar to ASP.Net from Microsoft. In ASP.Net v1, component rendering code was bundled with the UI component, unlike JSF, where rendering and component interfaces can be separated, thus allowing for customization of the renderer. ASP.Net v2 introduced the control adapter framework allowing the default rendering to be overridden by third-party code.

Business code is connected to the UI components by subscribing to events generated by the components and stored in a separate file ("code behind"). Thus a typical ASP.Net page consists of a (HTML) file describing the visual page layout (design), and a file with the page logic (code). Both files are treated as one single entity by Visual Studio.

According to the author of the book "Core JSF", JSF offers a means for Java to compete with ASP.Net/Visual Studio in the area of Rapid application development (RAD).

See also

* GUI
* Web portal
* Struts
* faces-config.xml

References

* [http://java.sun.com/j2ee/javaserverfaces/ JSF home page]
* [http://java.sun.com/j2ee/javaserverfaces/download.html JSF specification]
* [http://www.jcp.org/en/jsr/detail?id=314 JSR 314] (JSF 2.0)
* [http://www.jcp.org/en/jsr/detail?id=252 JSR 252] (JSF 1.2)
* [http://www.jcp.org/en/jsr/detail?id=127 JSR 127] (JSF 1.0 and 1.1)

Books

* Jonas Jacobi, John R. Fallows: Pro JSF and Ajax, Apress, ISBN 1-59059-580-7
* Chris Schalk, Ed Burns, James Holmes: JavaServer Faces: The Complete Reference, McGraw-Hill Osborne Media, ISBN 0-07-226240-0
* David Geary, Cay Horstmann: Core JavaServer Faces, Second Edition, Prentice-Hall, 2007 ISBN 0-13-173886-0
* Kito D. Mann: JavaServer Faces in Action, Manning Publications Company, ISBN 1-932394-12-5
* Bill Dudney, Jonathan Lehr, Bill Willis, LeRoy Mattingly: Mastering JavaServer Faces, John Wiley & Sons, ISBN 0-471-46207-1
* Hans Bergsten: JavaServer Faces, O'Reilly & Associates, ISBN 0-596-00539-3
* Budi Kurniawan, Nancy Maragioglio: JavaServer Faces Programming, McGraw-Hill Osborne Media, ISBN 0-07-222983-7
* James Turner, Craig McClanahan, Kunal Mittal: JavaServer Faces Kick Start, SAMS, ISBN 0-672-32599-3
* John Ferguson Smart: JSF Jumpstart - A tutorial introduction to building web sites using JSF, published in electronic form.

External links

* [http://www.coreservlets.com/JSF-Tutorial/ Core Servlets Tutorials] Core Servlets Page
* [http://www.jcp.org/en/jsr/detail?id=276 JSR 276] Design-Time Metadata for JavaServer Faces Components
* [http://www.jamesholmes.com/JavaServerFaces/ James Holmes' JSF Resources] Extensive listing of JSF articles, blog entries, tutorials, and more
* [http://www.jsfcentral.com/ JSF Central] JavaServer Faces Community
* [http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSFIntro.html JSF part] of Java EE tutorial
* [http://www.jsftutorials.net JSF Tutorials, Examples and Articles catalog]
* [https://javaserverfaces.dev.java.net/ JavaServer Faces Home] The project page for JSF at java.net
* [http://myfaces.apache.org/ Apache MyFaces] The Apache MyFaces Project, an open-source implementation of JSF under the umbrella of the Apache Software Foundation.
* [http://www.oracle.com/technology/tech/java/jsf.html Oracle resources on Java Server Faces]
* [http://www.zkoss.org/doc/ext/ZKStrutsJSFPrintedVersionJM1007.pdf JSF, Struts and ZK comparison on Javamagazin] (German)
* [http://www.jsfmatrix.net/ JSF Matrix] listing various JSF implementations and their features
* [http://www.j4fry.org/J4Fry_Quick_Setup_Tomcat_MyFaces_Hibernate/index.faces Component Examples] show the use of standard and extended components


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать реферат

Look at other dictionaries:

  • JavaServer Faces — (kurz: JSF) ist ein Framework Standard zur Entwicklung von grafischen Benutzeroberflächen für Webapplikationen. Basierend auf Servlets und JSP Technologie, gehört JSF zu den Webtechnologien der Java Platform, Enterprise Edition (Java EE).… …   Deutsch Wikipedia

  • JavaServer Faces — Тип Веб фреймворк Разработчик Sun Microsystems Написана на Java Операционная система Кроссплатформенное ПО …   Википедия

  • JavaServer Faces — Desarrollador Sun Microsystems http://java.sun.com/... Información general Última versión estable 2.0 …   Wikipedia Español

  • JavaServer Faces — Java Server Faces[1] (abrégé en JSF) est un framework Java, pour le développement d applications Web. À l inverse des autres frameworks MVC traditionnels à base d actions, JSF est basé sur la notion de composants, comparable à celle de Swing ou… …   Wikipédia en Français

  • JavaServer Pages — (JSP) is a Java technology that allows software developers to dynamically generate HTML, XML or other types of documents in response to a Web client request. The technology allows Java code and certain pre defined actions to be embedded into… …   Wikipedia

  • JavaServer Pages — JavaServer Pages, abgekürzt JSP, ist eine von Sun Microsystems entwickelte, auf JHTML basierende Web Programmiersprache zur einfachen dynamischen Erzeugung von HTML und XML Ausgaben eines Webservers. Sie erlaubt, Java Code und spezielle JSP… …   Deutsch Wikipedia

  • Faces-config.xml — is a key configuration file type within a JavaServer Faces (JSF) software implementation.The Java Platform, Enterprise Edition specification refers to this type of file as an Application Configuration Resource File. There may be more than one… …   Wikipedia

  • Java Server Faces — JavaServer Faces (kurz: JSF) ist ein Framework Standard zur Entwicklung von Benutzeroberflächen für Webapplikationen. Basierend auf Servlets und JSP Technologie, gehört JSF zu den Webtechnologien der Java Platform, Enterprise Edition (Java EE).… …   Deutsch Wikipedia

  • .jsp — JavaServer Pages, abgekürzt JSP, ist eine von Sun Microsystems entwickelte auf JHTML basierende Technik, die im Wesentlichen zur einfachen dynamischen Erzeugung von HTML und XML Ausgaben eines Webservers dient. Sie erlaubt, Java Code und… …   Deutsch Wikipedia

  • JSP — JavaServer Pages, abgekürzt JSP, ist eine von Sun Microsystems entwickelte auf JHTML basierende Technik, die im Wesentlichen zur einfachen dynamischen Erzeugung von HTML und XML Ausgaben eines Webservers dient. Sie erlaubt, Java Code und… …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”