To minimize installation complexities, choose the "zip" file.
Save the zip file (named something like jakarta-tomcat-5.5.7.zip)
to your computer.
Unzip the file into a directory of your choice (such as /usr/local
or c:\). The program is contained in a subdirectory named
something
like jakarta-tomcat-5.5.7.
NOTE: For your own sanity, do not unzip into a directory
containing spaces (such as Program Files or My Documents).
Save the zip file (named something like jsf-1_1_01.zip)
to your computer.
Unzip the file into a directory of your choice (such as /usr/local
or c:\). The program is contained in a subdirectory named
something
like jsf-1_1_01.
NOTE: For your own sanity, do not unzip into a directory
containing spaces (such as Program Files or My Documents).
Copy all JAR files files from the lib subdirectory of
your JSF installation (such as c:\jsf-1_1_01\lib) to the common/lib
subdirectory of Tomcat (such as c:\jakarta-tomcat-5.5.7\common\lib).
At the time of this writing, these files are
jsf-api.jar
jsf-impl.jar
commons-beanutils.jar
commons-collections.jar
commons-digester.jar
commons-logging.jar
Copy the following two JAR files from the webapps/jsp-examples/WEB-INF/lib
subdirectory of your Tomcat installation (such as c:\jakarta-tomcat-5.5.7\webapps\jsp-examples\WEB-INF\lib)
to the common/lib subdirectory of Tomcat (such as c:\jakarta-tomcat-5.5.7\common\lib):
jstl.jar
standard.jar
Starting and Stopping Tomcat
Open a command shell and change your directory to the Tomcat
directory
(such as /usr/local/jakarta-tomcat-5.5.7 or c:\jakarta-tomcat-5.5.7)
Change to the bin subdirectory
Type startup.sh (Unix) or startup.bat
(Windows) followed
by ENTER
Point your web browser to http://localhost:8080. You
should
get a "Congratulations" page.
To stop the Tomcat server, type shutdown.sh (Unix) or shutdown.bat
(Windows) followed by ENTER.
Building Applications
Create a subdirectory with the name of your web application (such
as myproject) inside the webapps directory of your
Tomcat directory (such as c:\jakarta-tomcat-5.5.7\webapps\myproject)
Inside that subdirectory, create the following directory
structure: myproject
WEB-INF
classes
mypackage
Place your files as follows:
index.jsp and other web pages into myproject
faces-config.xml and web.xml into myproject/WEB-INF Your faces-config.xml file depends on your
application. It contains your bean definitions and navigation rules.
Your web.xml file is always the same, like this: <?xml version="1.0"?>
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
Source code for your beans into myproject/WEB-INF/classes/mypackage
(where mypackage should be the package name that you use for
your classes, such as bigjava).
Here is an example:
Compile your beans, from the classes directory. Open a
shell and issue commands similar to these:
cd c:\jakarta-tomcat-5.5.7\webapps\myproject\WEB-INF\classes javac mypackage\*.java
Point your browser to http://localhost:8080/myproject/index.faces.
(NOT .jsp!)
Your application should start.
Troubleshooting tips
If you get an exception stack trace, read it. There is
often a useful tip in there somewhere.
If your page is displayed but it seems dysfunctional, choose
"View Source" from the browser menu.
Logs are available in the logs subdirectory of the
Tomcat directory (such as c:\jakarta-tomcat-5.5.7\logs). The
most useful log is catalina.out. The newest error messages
are at the end of the file
Carefully check that all XML tags match up in the JSP and XML
files. An XML-aware editor can be very helpful for this task.
If all else fails, try stopping and restarting Tomcat.