1 / 11

JavaServer Faces: Sample App + Life Cycle

JavaServer Faces: Sample App + Life Cycle. Compiled from Sun TechDays workshops (JSF Basics, Web-Tier Codecamp: JavaServer Faces, Java Studio Creator). Sample JSF Application. guessNumber application that comes with JSF 1.0 as part of J2EE 1.4 SDK

nora-tyler
Download Presentation

JavaServer Faces: Sample App + Life Cycle

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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 LifecyclePhases • 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. Request Processing Lifecycle Source: 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

More Related