JavaServer Faces Note(2)

jieforest發表於2007-07-21

JavaServer Faces Note(2)
First and foremost, a JSF configuration file (faces-config.xml) is an XML document whose root node is .
1) You can declare one or more JavaBeans for use in your application in this file.
2) You can give each one a name, a description, and a scope, and you can even initialize its properties.
3) Objects declared in a configuration file are called managed beans.
Declaring navigation is as simple as declaring a managed bean. Each JSF application can have one or more navigation rules.
It's worthwhile to point out that some aspects of JSF configuration, particularly navigation, can be handled visually with tools.

All J2EE web application are configured with a web.xml deployment descriptor; Faces applications are no different.
However, JSF applications require that you specify the FacesServlet, which is usually the main servlet for the application.
In addition, requests must be mapped to this servlet.

Summary
JavaServer Faces is a UI framework for building Java web applications; it was developed through the Java Community Process(JCP) and will become part of Java 2 Enterprise Edition. One of the main goals of Faces is to bring the RAD style of application development, made popular by tools like Microsoft Visual Basic and Borland Delphi, to the world of Java Web applications.

JSF provides a set of standard widgets (buttons, hyperlinks, checkboxes, and so on), a model for creating custom widgets, a way to process client-generated events on the server, and excellent tool support. You can even synchronize a UI component with an object's value, which eliminates a lot of tedious code.

All JSF applications are built on top of the Servlet API, communicate via HTTP, and use a display technology like JSP. JavaServer Faces applications don't require JSP, though. They can use technologies like XML/XSLT, other template engines, or plain Java code. However, Faces implementations are required to provide basic integration with JSP.

The component architecture of Faces leverages JavaBeans for properties, fundamental tool support, an event model, and several other goodies. JSF is considered a web application framework because it performs a lot of common development tasks so that developers can focus on more fun things like business logic.

One of the key features is support of Model 2 design pattern, which enforces separation of presentation and business logic code. However, Faces focuses on UI components and events. As such, it integrates quite nicely with the other frameworks like Struts, and overlaps quite a bit with the functionality of higher-level frameworks.

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/301743/viewspace-927301/,如需轉載,請註明出處,否則將追究法律責任。

相關文章