Stripes uses a lot of Java 5 features in order to make life easier. But that doesn't mean that it can't run on a Java 1.4 JVM. It just takes a little more work. This document walks through the process of using Retrotranslator to make a Stripes application work on in a Java 1.4 environment, using the Stripes examples web application as, well, the example.
At the time of writing there is one Java 5 feature that Stripes uses that is not supported by Retrotranslator. This has been fixed in the Stripes subversion source tree, and will be released as part of Stripes 1.3.2. Until such time, it is necessary to build Stripes from source in order to work with Java 1.4. The following shows how to get a working build of Stripes from source. You'll need to have ant and a subversion client installed.
Next, go and grab Retrotranslator from Sourceforge. Unpack it and you should see something like the following:
The first two jars contain classes that must be present at runtime, so they need to get copied into the application's classpath. In the case of the examples application, we'll copy them into the WEB-INF/lib directory:
We need to Retrotranslate both stripes.jar and any classes in the examples application that use Java 5 constructs. To do this we'll execute Retrotranslator from the command line as follows:
We're almost done. We need to make one last change, replacing references to Java 5 classes in the Tag Library Descriptor. You can do this at the command line, or using your favorite editor. E.g.
And we're done! You should now be able to jar up the contents of the web directory and deploy it to a server running under Java 1.4 and it'll work!
While it's only necessary to Retrotranslate stripes.jar once, it will be necessary to integrate a step into the build process of your application to Retrotranslate your application code after each compilation. You could do this through the command line in a manner similar to the one described above, but that seems a bit manual. Luckily Retrotranlator provides an ant task as part of the distribution, and there is also a maven plugin available. Instructions on using both are available from the Retrotranslator Homepage.
The only known issue at this time concerns the BigDecimalTypeConverter and the BigIntegerTypeConverter. At present these use an API that was added in Java 5 and is not currently supported by Retrotranslator. As such, if you need to use BigDecimal and BigInteger values in forms, you will need to create your own implementations of these classes.