[ Team LiB ] Previous Section Next Section

Installing Struts

To install the binary version of Struts, a few things must be in place. First, make sure that there is an installed version of the Java Development Kit, version 1.2 or later. This shouldn't be a problem because WebLogic ships with a JDK, but it's available for download from Sun if you don't have it. Second, an XML parser that's compatible with the Java API for XML (JAXP) version 1.1 or later is required to parse the various XML files. Again, WebLogic includes an XML parser, but if you want to use another one, Apache offers an open source parser named Xerces that works fine. Just remember to add the associated .jar files to the classpath. Third, download the binary version 1.1 or greater of Struts. A source version is also available, but it requires more libraries and must be compiled. This is beyond the scope of this chapter. Table 19.1 shows all the software needed to run Struts.

Table 19.1. Software Downloads Required to Use Struts

Software

Download Site

Java2 Development Kit version 1.2 or greater (optional; included with WebLogic)

http://java.sun.com/j2se

Xerces XML parser 1.3.1 (optional; included with WebLogic) Struts 1.1 or greater

http://xml.apache.org/xerces-j

http://jakarta.apache.org/struts

Now that Struts is downloaded, installation is simple. Unpack the zip file into a temp directory. Then copy the struts.jar, jakarta-oro.jar, jdbc2_0-stdext.jar, and all the common*.jar files to the WEB-INF/lib directory of the application you want to use Struts with. Then copy all the struts*.tld files and all the *.dtd files into the WEB-INF directory. Now make sure that all the JAR files are in the startup classpath of WebLogic. Table 19.2 shows the directory position of the files.

Table 19.2. Struts Application Files Per Directory

Directory

Files

WEB-INF/lib

struts.jar, jdbc2_0-stdext.jar, commons-*.jar

WEB-INF/

struts-*.tld, *.dtd

All the files necessary for Struts are now in the proper place in your Web application. However, before using Struts, certain configuration has to be done.

    [ Team LiB ] Previous Section Next Section