Struts Examples

These examples are intended to provide easy to understand samples of the most common struts tags and practices.

Warning!!

This page and the attached examples are very old now.

I have not updated the code or instructions in many years. Use at your own risk!
If you want to try something more up to date, I suggest looking at Struts 2.

Or how about something completely different?

The application demonstrates:

Downloading the examples

Download the examples (1.06Mb, .zip) and extract the enclosed struts-examples.war file. You can deploy the WAR file directly to your server.

Disclaimer: These examples are very old!

Running the examples (Tomcat standalone installation)

  1. Copy the WAR file to your Tomcat webapps directory (e.g. D:\Apache\jakarta-tomcat-4.1.18\webapps).
  2. Start (or shutdown and restart) Tomcat.
  3. The examples will be available at http://localhost:8080/struts-examples/ . (Assuming Tomcat is running on the default port 8080.)

Running the examples (Other containers)

The steps should be similar to the Tomcat installation but you will need to refer to the your container documentation for specific instructions for deploying a WAR file.

Building the examples

The sample applications are distributed as a compiled, packaged WAR file that can be deployed directly to your container as described above.

The classes in the distributed WAR file were compiled using IBM JDK 1.3.1.

If you wish to modify the examples, you will need to extract the files to a directory and recompile them. An Ant build file can be run from the WEB-INF directory and will compile the source files into the WEB-INF/classes directory.

You must set the path to the servlet.jar and jdbc20ext.jar files in a build.properties file in the same directory as build.xml. Servlet.jar is available in your Tomcat installation but you may need to obtain jdbc20ext.jar directly from Sun as it is not redistributable.

Support

You can seek help with Struts or these examples via the Struts Users mailing list. To sign up, visit http://jakarta.apache.org/site/mail.html .

You can email me directly if you know that my name is 'steve' and this domain is 'ninsky.com', but the Struts User list is a great place to ask Struts questions ;-)

 

Steve Raeburn, June 2003