Sample Applications with Java 1.4.x
Skip to end of metadata
Go to start of metadata

Sample Applications with Java 1.4.x

Icon

The Struts 2 home page states the Struts 2 requires Java 5. However, an alternate set of jars for Java 1.4.x are available. The challenge here is for people using Java 1.4.X is that the sample apps come with the Java 5 jars

Icon

Visit Stuts 2 Documentation for the official project documentation


Getting the Sample applications to work on 1.4.x

What are the Struts 2 included sample applications ?

The sample applications available with Struts 2.x include:
struts2-blank-2.0.x.war
struts2-mailreader-2.0.x.war
struts2-portlet-2.0.x.war
struts2-showcase-2.0.x.war

More Information on the sample applications can be found here:

What are the required Jars present in the sample applications ?

The sample application jars include:

commons-collections-3.1
freemarker-2.3.4
spring-aop-1.2.8
spring-context-1.2.8
spring-web-1.2.8
struts2-core-2.0.1
commons-logging-1.0.4
ognl-2.6.7
spring-beans-1.2.8
spring-core-1.2.8
struts2-api-2.0.1
xwork-2.0-beta-1

Where can the alternative "java 1.4.x" jars be found?

The Java 1.4.x zip file can be found (i.e. struts-2.0.x-j4.zip) :

What else must you do ?

There is a backport folder located in the j4 zip file.

Altenatively, you can find the backport files here:

In summary the steps you should perform:

  • You must put these files contained in backport folder into your WEB-INF/lib folder. I got the files from the backport folder in nightlies which i copied to ... \WebContent\WEB-INF\lib
  • There is a translate.bat file located in the backport file. You can run this bat file to
    convert your Java 5 jars into j4. I modified the translate.bat as follows:

java -jar retrotranslator-transformer-1.0.8.jar -srcjar struts2-core-2.0.1.jar -destjar struts2-core-j4-2.0.1.jar
java -jar retrotranslator-transformer-1.0.8.jar -srcjar struts2-api-2.0.1.jar -destjar struts2-api-j4-2.0.1.jar
java -jar retrotranslator-transformer-1.0.8.jar -srcjar xwork-2.0-beta-1 -destjar xwork-2.0-j4.jar

  • invoke translate.bat
  • It is important to note that you will have to replace the following jars mentioned above with java 1.4.x equivalents:
    struts2-core-2.0.1 with struts2-core-j4-2.0.1.jar
    struts2-api-2.0.1 with struts2-api-j4-2.0.1.jar
    xwork-2.0-beta-1 with xwork-2.0-j4.jar

Note: You can either use the translate bat file to get j4 jars or get it from the j4 zip download.

What jars should you have in your WEB-INF/lib folder after performing these steps:

commons-collections-3.1
commons-beanutils-1.6
commons-digester-1.6
commons-logging-1.0.4
freemarker-2.3.4
spring-aop-1.2.8
spring-context-1.2.8
spring-web-1.2.8
retrotranslator-runtime-1.0.8
retrotranslator-transformer-1.0.8
ognl-2.6.7
spring-beans-1.2.8
spring-core-1.2.8
struts2-core-j4-2.0.1
struts2-api-j4-2.0.1
xwork-2.0-j4
backport-util-concurrent

Labels
  • No labels