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.