JavaServer Faces (JSF) is a new standard Java framework for building WEB applications. It simplifies development by providing a component-centric approach to developing a Java Web user interface. JavaServer Faces also aroused the interest of the broad java/web developers. Enterprise developers and Web designers will find that JSF development is simple enough to drag user interface (UI) components onto the page, and system developers will find that rich and robust JSF APIs provide them with unmatched functionality and programmatic flexibility. JSF also passes a well constructed model-view-controller
(MVC) Design patterns are integrated into its architecture to ensure higher maintainability of the application. Finally, because JSF is a Java standard developed through the Java Community Process (JCP), development tool vendors are fully capable of providing an easy-to-use, efficient visual development environment for JavaServer Faces.
This article is about JSF. Start with a simple JSF introduction to unfamiliar readers: JSF is the standard for Java web and may replace the JSP era. JSF literal translation is the user interface framework for Java Web applications.
JSF provides a set of APIs and tag libraries to create page forms and complex interface elements
JSF makes it easier to write the form submission code that responds to those different button submissions, alters some values or some user's choices, and so on
Managed beans: Enables JSF to simplify processing request parameters
EL (Expression Language): JSF set of expression languages used to access properties of Java beans as well as collection elements.
Provides form field type conversion and validation
Unique properties
UI Component Model
JSF provides a rich and flexible set of component models, including:
A set of UIComponent classes that define the state and behavior of the UI component.
Rendering models: Defining how to render components in different ways
Event and listener models are used to process components.
Transformation Model: Data Conversion
Validating the Model: How to verify the legality of the data
Getting Started with JSF: Data transformation model
When a component is bound to an object, there are a total of two views for component data:
One is the model view: From this perspective, the data behaves as a type of Java object, such as int, long,date, etc.
One is to render the view: From this perspective, the data is represented as a form that can be read or modified by a person. For example, a date type may be displayed as a string in a yyyy-mm-dd format, or three strings, representing the year, month, and day, respectively.
You can define your own converters to transform the data.
Getting Started with JSF: Event and Listener models
Events: Value changes events, action events, data Model events.
Value change: For example, the value of the input box is changed, checkbox is selected, etc.
Action event: Click on a button or hyperlink
Data Model Event: This event is triggered when a row of the Uidata component is selected.
Getting started with JSF: Navigating models
Navigation-rule, which can contain a from-view-id and multiple navigation-case
In each navigation-case, the main includes the steering page.
From-view-id: Current Page
From-action: from which action method
From-outcome: from which logical name
To-view-id: Which page to turn to
The problem with navigation is: from where to where. In a word: from the From-view-id page, when the From-action method is invoked and its return value is From-outcome, it turns to the To-view-id page.
This article links http://www.cxybl.com/html/wyzz/JavaScript_Ajax/20130711/39050.html
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.