Helping ordinary people create extraordinary websites!
GET OUR NEWSLETTER
Your Email:
 

JSF for Nonbelievers: The JSF Application Lifecycle

By Rick Hightower
2005-05-05


Let's Code it

The best way to get started with coding the example application is to walk through its use cases:

1. Add a new CD
2. Edit an existing CD
3. Sort CDs by title
4. Sort CDs by artist

The code for the third and fourth use cases will be nearly identical, so I'll show you how to sort by title and leave the fourth as an exercise for you to complete on your own. We'll code the use cases soon, but first, let's take a look at what the pages will look like for the completed application.

Figure 4 shows the CD listing page with its sortable columns.

Figure 4. The CD listing page with sortable columns


Figure 5 shows the CD form page with its category component.

Figure 5. The CD form page with no category selected


Figure 6 shows the CD form page with its category and subcategory components.

Figure 6. The CD form page with categories and subcategories selected


Not quite CRUD
Note that the application is not an actual CRUD listing. It's really just a CRU listing, as I've left the D for you to implement. But don't sweat it -- it's quite easy. The steps for the delete operation are similar to the ones for the edit operation, which I've implemented for you here. Can you complete the CRUD?

Tutorial Pages:
» Walk Through the 6 Phases of JSF's Request Processing Lifecycle
» The JSF Lifecycle: an Overview
» Phase 1: Restore View
» Phase 2: Apply Request Values
» Phase 3: Process Validation
» Phase 4: Update Model Values
» Phase 5: Invoke application
» Phase 6: Render Response
» A Working Example
» Let's Code it
» Use Case 1: Add a New CD
» Use Case 2: Edit a CD
» Use Case 3: Sort CDs
» Immediate Event Handling
» Conclusion
» Resources


First published by IBM DeveloperWorks


 | Bookmark
Related Tutorials:
» All about JAXP, Part 1
» Make Database Queries Without the Database
» Load List Values for Improved Efficiency
» 2 Ways To Implement Session Tracking
» A Simple Way to Read an XML File in Java
» Develop Aspect-Oriented Java Applications with Eclipse and AJDT

Advertise with Us!


Tutorials Scripts Web Hosting Developer Manuals
Resources