Java
  Home arrow Java arrow Page 5 - Introduction to JavaServer Faces Part ...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
VeriSign Whitepapers 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVA

Introduction to JavaServer Faces Part 2
By: McGraw-Hill/Osborne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 20
    2004-03-15

    Table of Contents:
  • Introduction to JavaServer Faces Part 2
  • The Action Listener
  • Continuing With the navigateComponent Tree
  • Console Message
  • And the Message
  • Authoring the JSP Page for the Validator Example

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Introduction to JavaServer Faces Part 2 - And the Message


    (Page 5 of 6 )

    More informative is the message that is displayed in the console:

    getFirstNumber: 0
    getSecondNumber: 0
    processAction called
    The id of the component that fired the action event: submitButton
    Action command: submit
    ----------- Component Tree -------------
    null
      addForm
        firstNumber
        secondNumber
        output
        submitButton
    ----------------------------------------
    setFirstNumber: 10
    setSecondNumber: 20
    getFirstNumber: 10
    getSecondNumber: 20
    getResult: 30

    Creating the Validator Example

    The example presented in this section demonstrates how you can validate user input very easily in JSF. This application is even simpler than the one presented in the previous section. It consists of only one JSP page, and it does not require a JavaBean or an application configuration file. However, you will still need a directory structure for the application and the deployment descriptor. The deployment descriptor is the same as the one in Listing 1. Here, we will look at the directory structure and JSP page.

    Creating the Directory Structure for the Validator Example

    The directory structure for your application, called JSFCh02b, is depicted in Figure 8. In Tomcat, you create this under webapps. The directory contains all the required components that you will build in this example.

    Again, you must copy the .jar files containing the JSF implementation into the WEB-INF/lib directory. Then, in the application directory, you have the validatorTest.jsp page.

    Buy this book now!Remember: This is part one of the second chapter of JavaServer Faces Programming, by Budi Kurniawan (McGraw-Hill/Osborne, ISBN 0-07-222983). Stay tuned for more helpful chapters from McGraw-Hill/Osborne.
    Buy this book!

    More Java Articles
    More By McGraw-Hill/Osborne


     

       

    JAVA ARTICLES

    - Adding Images With iTextSharp
    - Adding Columns With iTextSharp
    - Creating Simple PDF Files With iTextSharp
    - The Spring Framework: Understanding IoC
    - Introducing the Spring Framework
    - Java Classes
    - Completing the Syntactic Comparison of Java ...
    - Syntactic Comparison of Java and C/C++
    - Java Statements
    - Conditionals, Expressions and Other Java Ope...
    - Java Operators
    - Primitive Data Types and Basic Language Rule...
    - Java and Object-Oriented Programming
    - Java Beginning Programming
    - Gaming Development Setup





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway