VisualBuilder
  Home > Jsp > Tutorials > Life Cycle of JSF Application - JSF Tutorial
Tell a friend
Link to us
Total Members
      Members: 84661
     
Sitemap Forum Chat
Home
JSF Tutorial Home
1 . Introduction to JSF
2 . Life Cycle of JSF Application
3 . JSF Releases
4 . Comparing JSF With Existing Web Technologies
5 . Steps To Create JSF Application Using NetBeans IDE
6 . Web.xml file
7 . First Hello World Application
8 . Running the Application
9 . Introduction To JSF Tag Libraries
10 . Form Designing With JSF
11 . Using Managed Bean With JSF -1
12 . Using Managed Bean With JSF -2
13 . Using Javascript to Validate Form
14 . Adding Navigation in JSF Application
15 . Creating the Reponse page for Registration Application
16 . Conversion Model of JSF
17 . Example Continued For Conversion Model
18 . Displaying the Data in Data Table
19 . Example Continued For Data Table
 
 
JSP Home
JSP Members (18709)
JSP Member Articles ( 11 )
JSP Discussion (71)
JSP Q & A ( 87 )
- JSP Ask Question
- JSP Questions
- JSP Unanswered Questions
JSP Resources
JSP Source Code (172)
JSP Articles (34)
JSP Blogs (333)
JSP Jobs (0)
JSP Components (10)
JSP Books (9)
JSP Websites (13)
JSP News (12)
 
GROUPS
.NET
ASP.NET
.NET
C#
ASP
Visual Basic
Java
Java
JSP
EJB
Other
Delphi
C++
Ajax
UML
JavaScript
PHP
Web Design
Web Hosting
SQL Server
Oracle
Project Management
More Groups

 
LEARNING CENTER
TUTORIALS
.NET
.NET Tutorial
ASP Tutorial
ASP.NET Database Tutorial
ASP.Net Security,Internationalisation And Deployment
ASP.NET Tutorial
C# Tutorial
Web Development
Flex Tutorial
HTML Tutorial
Learn AJAX Tutorial
PHP Tutorial
Software Development
Database Tutorial
SQL Tutorial
UML Tutorial
Java
Ant Tutorial
EJB 3 Tutorial
Hibernate Tutorial
Java Tutorial
Java Web Component Tutorial
Java XML Tutorial
JDBC Tutorial
JDK1.5 Tutorial
JSF Tutorial
JSP And J2EE Design Tutorial
JSP Tutorial
Spring Tutorial
Struts Tutorial

RESOURCES
Q & A (451 )
Source Code (3275 )
Articles (359 )
Books (372 )
Components (1596 )
News (892 )
Websites (1207 )

SUBMISSIONS
Submit Article
Submit Website
Submit News
Submit Source Code
Submit Component

COMMUNITY
Members Directory
Discussion Forum
Chat

SITE
About Us
Sitemap
Search
Contact Us
Link To Us
Feedback
Tell a Friend
Partners
Advertise

Jsp jsf Tutorial
 Life Cycle of JSF Application
  << Prev: Introduction to JSF Next: JSF Releases >>

The life cycle is defined as the processes and phases needs to go through to generate the response for a given request. For JSF, it consists of following six steps that an application follows when any request comes to the system for the processing.

Life Cycle of phase can be described as:



Phase 1: Restore View
A request comes via the FacesServlet controller. It examines the request and extracts the view ID that is determined by the name of the JSP page. The JSF framework controller uses the view ID to look up the components for the current view. If the view doesn't already exist, the JSF controller creates it. If the view already exists, the JSF controller uses it. The view contains all the GUI components. This phase of the lifecycle presents three view instances: new view, initial view, and post back, and each one handled separately.


Phase 2: Apply request values
In this phase each component retrieves its current state. The components are first retrieved or created from the FacesContext object, followed by their values which are typically retrieved from the request parameters, although they can also be retrieved from cookies or headers. If a component's immediate event handling property is not set to true, the values are just converted. So if the field is bound to an Integer property, the value is converted to an Integer but if value conversion fails, an error message is generated and queued in the FacesContext to be displayed in the render response phase.


Phase 3: Process validation
The first event handling of the lifecycle takes place after the apply request values phase. In this stage, each component have its values validated against the application's validation rules. The validation rules can be pre-defined or defined by the developer. Values entered by the user are compared to the validation rules. If an entered value is invalid, an error message is added to FacesContext, and the component is marked invalid. If a component is marked invalid, JSF advances to the render response phase, which will display the current view with the validation error messages.


Phase 4: Update model values
It updates the actual values of the server-side model, by updating the properties of backing beans (also known as managed beans). Only bean properties that are bound to a component's value will be updated. As this phase happens after validation, so the values copied to bean's properties are also valid.


Phase 5: Invoke application
Here the JSF controller invokes the application to handle Form submissions. The component values are converted, validated, and applied to the model objects, so we can now use them to execute the application's business logic. At this phase the next logical view for a given sequence or number of possible sequences are specified by defining a specific outcome for a successful form submission and returning that outcome.
For example: on successful outcome, move the user to the next page. For this navigation, create a mapping to the successful outcome as a navigation rule in the faces-config.xml file. Once the navigation occurs, can move to the final phase of the lifecycle.


Phase 6: Render response
Render Response view with all of its components in their current state are displayed. The application utilizes common JSF GUI components like Radio List, List, Text Field, Label, Panel etc.


  << Prev: Introduction to JSF Next: JSF Releases >>
Jsp Jsf Tutorial Home
Give feedback and win a prize.

 
   Printer Friendly
   Email to a friend
   Add to my Favourites    
  Download PDF version
   Report Bad Submissions
   Submit Feedback
 
  Delicious   Digg   Technorati   Blink   Furl   Reddit   Newsvine   Google Click each image to add
this page to each site.
 
 
Welcome Guest Signup
MEMBER'S PANEL
EMAIL
PASSWORD
Forgot your password?
New User? Click Here!
 
Resend Activation Email!
 
SEARCH
 
 
 
ADVERTISEMENT
Partner List
Code Project
ASP Alliance
More
 
 
 
 

Home | Login | About Us | Contact Us | Privacy Policy | Advertising