Two main points of JSF: component-Oriented Programming and event-driven models

Source: Internet
Author: User

I recently completed a large-scale project for developing the JSF framework, and I was inspired by the use of the JSF framework.

Two highlights of JSF are:

For component programming and event-driven models,

1. component-oriented (Component) mode. Here, there can be two components. One is the UI components supported by JSF (different support vendors have different UI component implementations, such as Apache, oracle), there is also a component in the sense, that is, the openness of the JSF framework-let users define their own components, such components include some components on lifesicle, for example, the UI component, validator component, and handler component.

2. The event-driven mode is relative to the struts MVC mode. In struts, a form can only correspond to one action (dispatchaction). That is to say, in struts, a form can only correspond to one event. In struts, this event method is used to teach application event, compared with component event, application event is a coarse-grained event.

In struts, the form object actionform is an object that represents an application. This object often contains all fields on the page. Therefore, a form corresponds to an event, when we need to refine the granularity to the field level, Struts itself will not be able to meet the needs, and usually need to use JavaScript. A large number of scripts are on the page, which is obviously not very clever.

The event-driven mode is method-level. Because JSF has the help of valuechangelistener.

Event-driven is possible.

JSF allows two events for the component, value changed listener and action. From the perspective of the JSF activity cycle, the valuechanged listener is before the action. So.

 

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.