Home arrow Java & J2EE arrow Page 4 - Introduction to JavaServer Faces, Part 3

Compiling and Running the Page Navigation Example - Java

This chapter has been leading us gently through the JavaServer Faces technology. More importantly, in it, Budi teaches ushow to write an online survey application to get a feel for how this great technology works. This chapter prepares you for the next chapters by introducing the JSF Application Programming Interface (API) and the Application Configuration file. This excerpt comes from chapter two of JavaServer Faces Programming, by Budi Kurniawan (McGraw-Hill/Osborne, ISBN 0-07-222983-7, 2004).

TABLE OF CONTENTS:
  1. Introduction to JavaServer Faces, Part 3
  2. Wrtiting the JSP Files for the Page Navigation Example
  3. Creating the Application Configuration File for the Page Navigation Example
  4. Compiling and Running the Page Navigation Example
  5. Introducing the JSF Application Programming Interface (API)
  6. javax Packages
  7. More javax Packages
By: McGraw-Hill/Osborne
Rating: starstarstarstarstar / 21
March 22, 2004

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

To compile the application, change to the JSFCh02c/WEB-INF/classes directory. If you are using Windows, type the following command:


javac -classpath ../lib/jsf-api.jar;../lib/jsfrijar;../../../../common/lib/servlet-api.jar ch02c


Note that you need two library files in the lib directory and the servlet-api.jar file. In Tomcat 5, the servlet-api.jar file can be found in the common/lib directory of Tomcat’s home directory.

If you are using Linux/Unix, replace the semicolons that separate library files with colons:


javac -classpath ../lib/jsf-api.jar:../lib/jsfrijar:../../../../common/lib/servlet-api.jar ch02c


To run the application, direct your browser to the following URL:


http://localhost:8080/JSFCh02c/faces/page1.jsp 

JSF survey page
Figure 11 The survey page

You will see something similar to Figure 11.

Type something in both input boxes and click Submit. You will see a result similar to Figure 12 in your browser.

If you click the Go Back button in the second page (page2.jsp), you will go back to the first page. 

JSF response
Figure 12 The response page

Buy this book now!Remember: This is part three of the second chapter of JavaServer Faces Programming, by Budi Kurniawan (McGraw-Hill/Osborne, ISBN 0-07-222983). If you've enjoyed what you've seen here, click on the "Buy it now!" banner to pick up a copy today!
Buy this book!



 
 
>>> More Java & J2EE Articles          >>> More By McGraw-Hill/Osborne
 

blog comments powered by Disqus
   

JAVA & J2EE ARTICLES

- NetBeans 7.1 Released, Supports JavaFX 2
- SolarWinds Releases Newest Version of Java M...
- Free Monitoring Tool for Java Apps on Heroku
- Heroku Adds JCloud Platform Support, Java 7 ...
- Java SE 8 Speculation in Full Swing
- Java SE 7 Now Available
- New JVM Language and Java Reporting Tool
- Java 7 Release Update and New Eclipse Toolkit
- The Best Java Netbeans IDE Plugins
- Java EE 7 Looks to the Cloud
- Oracle Seeks Billions from Google Over Patent
- Oracle Java 6 Update Fixes Security Vulnerab...
- RIM Releases New BlackBerry Java SDK
- Oracle Now Offering JRockit for Free
- Google App Engine Includes Java Backend


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 10 - Follow our Sitemap

Dev Shed Tutorial Topics: