Appendix: Installing Struts on Tomcat 5.5.x
While this isn't really a tutorial about Struts itself, I want to briefly run through a simple Struts installation. While I hope that you already have some basic Struts experience, I realize that many of you may be trying out Struts by way of this tutorial. If you're in that category, walk through these steps to get Struts and the example application up and running.
- Start out by going to the Struts Web site. On the left side of the page, you'll see a Downloads heading (you may have to scroll down a bit); underneath that, select Binaries.
- Choose an alternate mirror if you like (I generally use the default mirror site), and find the first entry under Full Releases. As I write this, that's Struts 1.2.4 (see Figure 8).
- Select the download appropriate for your system, and download the file to your local machine.
Figure 8. Download the latest full binary release of Struts
- Once you've downloaded the file, go ahead and expand the archive; you should get a directory named something like jakarta-struts-1.2.4. At this point, you can delete the archive (and, if you created a TAR file in the process of decompression, delete that as well).
- Move your newly created Struts folder into a directory where you store your Java projects. I moved it into /usr/local/java on my system, resulting in /usr/local/java/jakarta-struts-1.2.4. Go ahead and navigate into that folder; it should look something like Figure 9:
Figure 9. There's really not much to a Struts binary release
- Drill down into the webapps folder; you should see several WAR files (there are five of these in Struts 1.2.4). Copy all of these files to your Tomcat webapps directory. If Tomcat isn't running, start it up. Tomcat will expand each of these WAR files, and automatically load the applications.
- To ensure that everything is working properly, navigate to http://localhost:8080/struts-example.
Note: I'm assuming a default Tomcat installation. If you've got Tomcat running on a different host, you'll obviously need to replace localhost with your server's hostname. If you don't have WARs automatically deployed, or if you use a different directory for your contexts, then you're no doubt comfortable enough with Tomcat to make the appropriate changes.
You should see something that looks like Figure 10:
Figure 10. The struts-example Web application is an easy way to ensure Struts is working
- You should click on a few links and make sure everything looks right; no error pages or odd messages should appear. If this all looks correct, then you've got a working Struts installation!


