Geary and Horstmann: Core JavaServer Faces

Here is my chapter 1 sample source code and what shows up after launch from NetBeans 6.1. Paths given here are those of NetBeans contrival. In Eclipse, Web Pages is Web Content and Source Packages is src.

Principally, the authors gave at least three possibilities for the starting page, index.html, index.jsp and start.jsp. I chose the last one. These possibilities led also to different values for the welcome-file element in web.xml. They also spoke of .jsp vs. .jsf vs. .faces extensions for files and also subdirectories off the application root (/faces/*).

While these are important points to make, making them in the first chapter—trying to cram the myriad possibilities into a simple example—was not a good idea at all. Looking back on this, any JSF-savvy person will ridicule the problem I had. Nevertheless, it's horribly frustrating to wade through HTTP 505 and other errors changing one variable at a time, when one good, easy success could open the door to a list of these points afterwards.

<bitter-rant>
This is a case of authors writing a book for an audience that understands as much or nearly so as they do. How much more useful could a book be that introduces the non-initiate into something? Maybe it's to maintain a raised bar on the high priesthood: few should be so silly as to try to get over it.
</bitter-rant>

The application was launched with the following command line:

	http://localhost:8084/CoreJSF/

...and the result appeared at:

	http://localhost:8084/CoreJSF/index.faces
Web Pages/start.jsp
Web Pages/index.jsp
Web Pages/welcome.jsp
 
Source Packages/com.corejsf/userbean.java
 
Web Pages/WEB-INF/faces-config.xml
Web Pages/WEB-INF/web.xml
 
build results for comparison


index.html and start.jsp, the latter is used here, but never actually shows up long enough to be seen, are different ways to get to index.jsp.

This is the index.jsp page:

Here is welcome.jsp which is reached by logging in: