Tuesday, May 15, 2007

JSF study notes

- a Java component-oriented web framework (RAD)
- allows developers to think in terms of components, events, backing beans and their interactions, instead of requests, responses, and markup.
- higher level abstraction, Servlets and JSP were developed to make it easier to build applications on top of HTTP protocol. JSF was introduced so that developers can forget that they're using the protocol at all.

def: a software component is a unit of composition with contractually specified interfaces and explicit context dependencies only (container). A software component can be deployed independently and is subject to composition by third parties.

1. value change event
2. data model event - data row selected
3. action event - command from button or link
4. phase event - request processing life cycle event

Phases: (translate http request to events and update server side components value)
1. restore view
- find/create components tree, including event listeners, validators,converters associates with components; if initial request, skip to phase 6

2. apply request values
- update value of components to values in request, converter may get involved
-'immediate' property may trigger action event, handy for 'Cancel' button

3. process validation
- component validate itself
- value change events fired

4. update model values
- update value of backing beans or model objects associated with components

5. invoke application
- action events fired

6. render response
- render response, and save view in user session (?) to be restored later

Question: why may date model events be fired in phase2 - phase 4?

- 且就洞庭赊月色, 将船买酒白云边。

No comments: