Presentation is loading. Please wait.

Presentation is loading. Please wait.

JavaServer Faces: Sample App + Life Cycle Compiled from Sun TechDays workshops (JSF Basics, Web-Tier Codecamp: JavaServer Faces, Java Studio Creator)

Similar presentations


Presentation on theme: "JavaServer Faces: Sample App + Life Cycle Compiled from Sun TechDays workshops (JSF Basics, Web-Tier Codecamp: JavaServer Faces, Java Studio Creator)"— Presentation transcript:

1 JavaServer Faces: Sample App + Life Cycle Compiled from Sun TechDays workshops (JSF Basics, Web-Tier Codecamp: JavaServer Faces, Java Studio Creator)

2 Sample JSF Application guessNumber application that comes with JSF 1.0 as part of J2EE 1.4 SDK Guess a number between 0 and 10, inclusive  The response page tells you if you guessed correctly Input validation

3 Starting Page

4 Failure Outcome Navigation

5 Success Outcome Navigation

6 Input Validation Error

7 Lifecycle of JSF Page A JSF page is represented by a tree of UI components, called a view When a client makes a request for the page, the lifecycle starts During the lifecycle, JSF implementation must build the view while considering state saved from the previous postback When the client performs a postback of the page, JSF implementation must perform lifecycle steps  validation  conversion

8 Request Processing Lifecycle Phases 1. Reconstitute component tree phase 2. Apply request values phase 3. Process validations phase 4. Update model values phase 5. Invoke application phase 6. Render response phase

9 Request Processing Lifecycle

10 Source: http://www.ibm.com/developerworks/library/j-jsf2/http://www.ibm.com/developerworks/library/j-jsf2/

11 Request Processing Life-cycle handles two types of requests  Initial request & Postback Initial request  A user requests the page for the first time  Lifecycle only executes the Restore View and Render Response phases Postback  A user submits the form contained on a page that was previously loaded into the browser as a result of executing an initial request  Lifecycle executes all phases


Download ppt "JavaServer Faces: Sample App + Life Cycle Compiled from Sun TechDays workshops (JSF Basics, Web-Tier Codecamp: JavaServer Faces, Java Studio Creator)"

Similar presentations


Ads by Google