Configuring the BC4J Toy Store Application to use the Struts 1.1 Final Release

Send me a mail
 Dive into Oracle ADF   Click to see the XML version of this web page.   (Updated: 2/3/2008; 9:24:48 PM.)
Tips and tricks from Steve Muench on Oracle ADF Framework and JDeveloper IDE

Configuring the BC4J Toy Store Application to use the Struts 1.1 Final Release

On Monday, June 30th, 2003, the Jakarta Struts team announced the availability of the Struts 1.1 Final release. The JDeveloper 9.0.3.1 release ships with, and has been tested against, the Struts 1.1 Beta2 release. This document describes the steps to follow in order to upgrade the BC4J Toy Store application to work against the Struts 1.1 Final release instead. You would follow similar steps to upgrade your own BC4J/Struts applications. An upcoming version of JDeveloper will ship with the Struts 1.1 Final release built-in and pre-tested, but these steps can assist you in making the move before that time.

Since the Struts team deprecated a few things between the Struts 1.1 Beta 3 and Final releases, small source code changes are required to three classes that are part of our BC4J/Struts support:

  • oracle.jbo.html.struts11.BC4JRequestProcessor
  • oracle.jbo.html.struts11.MultipartUtil
  • oracle.jbo.html.struts11.actions.UpdateAction

The changes relate to the deprecation of the ApplicationConfig in favor of the ModuleConfig in the Struts 1.1 Final source code base. The source code of these classes already ship as part of JDeveloper 9.0.3.1. If you are curious, you can find them in the ./BC4J/src/bc4jstrutssrc.zip file. For convenience, I've made the required modifications to these three classes and included them in this BC4JStruts11FinalModifications.zip file that you can download. For additional convenience, in the lib directory of this zip file's contents, you will find a version of the 9.0.3.1 bc4jstruts.jar file that I've updated to replace the three updated classes above.

After having downloading the Struts 1.1 Final Binary Distribution and the BC4JStruts11FinalModifications.zip file above, do the following to upgrade the demo to use Struts 1.1 Final:

  1. Make a backup copy of *.jar files in ./bc4jtoystore/webroot/WEB-INF/lib and *.tld files in ./bc4jtoystore/webroot/WEB-INF
  2. Delete struts.jar, commons*.jar, and bc4jstruts.jar from ./bc4jtoystore/webroot/WEB-INF/lib
  3. Copy ./jakarta-struts-1.1/lib/*.jar to ./bc4jtoystore/webroot/WEB-INF/lib
  4. Copy the bc4jstruts.jar containing the modified BC4J/Struts classes to ./bc4jtoystore/webroot/WEB-INF/lib
  5. Delete struts-*.tld from ./bc4jtoystore/webroot/WEB-INF
  6. Copy ./jakarta-struts-1.1/lib/struts-*.tld to ./bc4jtoystore/webroot/WEB-INF

Finally, you need to edit the following line in the ./bc4jtoystore/webroob/WEB-INF/struts-config.xml file to add a slash before the confirmshippinginfo.do value of the input attribute. That is, change this:

<action path="/finalizeorder" ... input="confirmshippinginfo.do" ... >

to look like this:

<action path="/finalizeorder" ... input="/confirmshippinginfo.do" ... >

This worked correctly without the leading slash in earlier Struts releases, but apparently a bug fix was made to be more stringent in how the paths are interpreted.

When you run the index.jsp page in the ToyStoreController.jpr project after making these modifications, you will be running with Struts 1.1 Final.



© Copyright 2008 Steve Muench. Click here to send an email to the editor of this weblog.
Last update: 2/3/2008; 9:24:48 PM.