Introduction to JavaServer Faces, Part 3 - Compiling and Running the Page Navigation Example
(Page 4 of 7 )
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/jsfri. jar;../../../../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/jsfri. jar:../../../../common/lib/servlet-api.jar ch02c
To run the application, direct your browser to the following URL:
http
://localhost:8080/JSFCh02c/faces/page1.jsp

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.

Figure 12 The response page
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! |
Next: Introducing the JSF Application Programming Interface (API) >>
More Java Articles
More By McGraw-Hill/Osborne