JavaServer Faces(JSF)是一个为网络应用程序构建基于组件的用户界面的Java规范,并已通过JCP格式化为Java EE的一部分。它也是一个MVC Web应用框架,通过在页面中使用可重用的UI组件简化了基于服务器的应用程序的用户界面(UI)。
版本
- JSF 2.3 (2017-03-28) — Major features: search Expressions, extensionless URLs, bean validation for complete classes, push communication using WebSocket, enhanced integration with CDI.
- JSF 2.2 (2013-04-16) — JSF 2.2 introduced new concepts like stateless views, page flow and the ability to create portable resource contracts.
- JSF 2.1 (2010-10-22) — Maintenance release of 2.0. Only very minor amount of spec changes.
- JSF 2.0 (2009-06-28) — Major release for ease of use, enhanced functionality, and performance. Coincides with Java EE 6.
- JSF 1.2 (2006-05-11) — 核心系统和API改进. Coincides with Java EE 5. Initial adoption into Java EE.
- JSF 1.1 (2004-05-27) — 错误修复,没有更改规范.
- JSF 1.0 (2004-03-11) — 初始规范发布.
技术的主要组件
为了展现UI组件和管理它们的状态;操作事件、服务器端的确认和数据变换;定义页面导航;支持国际化和可访问性;提供对所有特性的可扩展性的API为了在JSP中表示UI组件和拍发组件给服务器端对象的两个JSP自定义tag库。
JavaServer Faces技术好处
引入了基于组件和事件驱动的开发模式,使开发人员可以使用类似于处理传统界面的方式来开发Web应用程序。提供了行为与表达的清晰分离。
不用特别的脚本语言或者标记语言来连接UI组件和Web层。JSF技术API被直接分层在Servlet API的顶端。
技术为管理组件状态提供一个丰富的体系机构、处理组件数据、确认用户输入和操作事件。
JavaServer Faces应用程序
典型的JSF应用程序包含下列部分:
:*一组JSP页面
:*一组后台bean(为在一个页面上的UI组件定义的属性和函数的JavaBean组件)
:*应用程序配置资源文件(定义页面导航规则、配置bean和其它的自定对象,如自定义组件)
:*部署描述文件(web.xml)
:*一组由应用程序开发者创建的自定义对象(有可能)
:*一些可能包含自定义组件、约束、转换器或者监听器的对象
:*为在页面中表现自定义对象的一组自定义tag
包含JSP页面的JSF应用程序也使用由为了表现UI组件和在页面上的其他对象的JSF技术而定义的标准的tag库。
JavaServer Faces应用程序开发角色
- 页面作者:使用JSF标记库创建页面。
- 应用程序开发者:编写自定义转换器、约束、监听器和后台bean。
- 组件作者:创建自定义UI组件和实施者(renderer)。
- 应用程序建造者:配置应用程序,包括定义导航规则、配置自定义对象和创建部署描述文件。
参见
*J2EE
*Struts
参考资料
外部链接
- [http://www.theserverside.com/tt/articles/article.tss?l=JavaEE6Overview Brief review] on the latest changes to JSF 2.0 to be reflected in Java EE 6
- [https://web.archive.org/web/20170516222757/http://www.turngeek.press/jsfinaday/ Cloud Tutorial - JavaServer Faces in a Day] JSF Tutorial that embraces the use of a Cloud IDE to let you learn the fundamentals of JSF in just one day
- [http://www.coreservlets.com/JSF-Tutorial/ Core Servlets JSF Tutorials] Tutorials with Source Code
- [http://www.icesoft.org ICEfaces] Official site of the ICEfaces Open Source Project
- [http://www.jamesholmes.com/JavaServerFaces/ James Holmes' JSF Resources] Extensive listing of JSF articles, blog entries, tutorials, and more
- [http://java.sun.com/j2ee/1.4/docs/tutorial/doc Java EE 4 Tutorial] [http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSFIntro.html Chapter 17: JavaServer Faces Technology]
- [http://java.sun.com/javaee/5/docs/tutorial/doc/ Java EE 5 Tutorial] [http://download.oracle.com/javaee/5/tutorial/doc/bnaph.html Chapter 10: JavaServer Faces Technology]
- [http://java.sun.com/javaee/6/docs/tutorial/doc/ Java EE 6 Tutorial] [http://download.oracle.com/javaee/6/tutorial/doc/bnaph.html Chapter 4: JavaServer Faces Technology]
- [https://web.archive.org/web/20130816012958/http://docs.oracle.com/javaee/7/tutorial/doc/home.htm Java EE 7 Tutorial] [https://docs.oracle.com/javaee/7/tutorial/jsf-intro.htm Chapter 7: JavaServer Faces Technology]
- [http://www.jsfcentral.com/ JSF Central] JavaServer Faces Community
- [https://web.archive.org/web/20071025100203/http://www.jsfmatrix.net/ JSF Matrix] listing various JSF implementations and their features
- [http://www.sitenol.com/java-server-faces-jsf-tutorial-with-examples JSF Tutorial Sitenol] JSF tutorials, examples and good email support for coding problems
- [https://web.archive.org/web/20150810230104/http://memorynotfound.com/category/java/jsf/ JSF Tutorials Memorynotfound] JSF tutorials, Code Examples, Best Practices
- [https://web.archive.org/web/20180720072828/http://www.jsftutorials.net/ JSF Tutorials, Examples and Articles catalog]
- [http://www.jcp.org/en/jsr/detail?id=276 JSR 276] Design-Time Metadata for JavaServer Faces Components
- JSF在java.net上的项目页面
- [http://www.primefaces.org PrimeFaces] Official site PrimeFaces
评论 (0)