Migrating Struts Web projects

For Struts Web projects created in WebSphere® Studio V5.1.x, you must make a small modification to the Web project's deployment descriptor in order to run the EAR project on WebSphere Application Server V6.0. You may also wish to manually convert existing Struts 1.0.2 or Struts 1.1 Beta (2 or 3) Web projects to Struts 1.1.

Modifying the deployment descriptor of existing Struts Web Projects

When a Struts project is created in WebSphere Studio v5.x, the config parameter (<param-name>config</param-name>) in the web project's deployment descriptor is set to WEB-INF/struts-config.xml. WebSphere Application Server V6.0 requires that a leading "/" be present in this parameter. If you run a Struts Web project that was created in WebSphere Studio V5.1.x on WebSphere Application Server V6.0, you may receive a java.net.MalformedURLException exception upon starting the EAR project.

Note: Rational® Application Developer V6.0 will add the "/" when a new Struts project is created; however, it must be added manually when migrating from WebSphere Studio V5.1x.
Follow these steps to correct in V6.0 the deployment descriptor of a Struts Web project that was created in WebSphere Studio v5.1.x:
  1. Open the Struts Web project in the Project Explorer.
  2. Double-click the Web project's Web Deployment Descriptor file in the Project Explorer. The Web deployment descriptor editor opens.
  3. Click the Source tab to open the Source page.
  4. Change the line

    <param-value>WEB-INF/struts-config.xml</param-value> (this is located within the <servlet></servlet> tags)

    to

    <param-value>/WEB-INF/struts-config.xml</param-value> .

  5. Save the Web Deployment Descriptor
The java.net.MalformedURLException exception should not occur when the EAR project is restarted.

Converting Struts 1.1 Beta Web projects to Struts 1.1

In WebSphere Studio V5.1.x, the Struts runtime library stepped up from Struts 1.1 Beta (2 or 3) in V5.0.x to Struts 1.1 (final). If you have existing Struts 1.1 Beta (2 or 3) Web projects and you want to convert them to Struts 1.1 (final), you may convert them manually. (Note: it is not required that you convert Struts 1.1 Beta (2 or 3) projects to Struts 1.1. )

To convert Struts 1.1 Beta (2 or 3) projects to Struts 1.1, do the following:
  1. Load your Struts 1.1 Beta projects into a Rational Application Developer V6.0 workspace.
  2. Create a new Struts 1.1 Web project named, for example, Struts11. You create this temporary project in order to provide convenient access to the Struts 1.1 runtime files you will need while you are converting your real projects. You can delete this project when you are done.
  3. For each Struts 1.1 Beta project that you want to convert to Struts 1.1, do the following:
    1. Delete the following JAR files from your project's Web Content/WEB-INF/lib directory:
      • commons-*.jar.
      • struts.jar.
    2. Copy the following JAR files from Struts11/WebContent/WEB-INF/lib directory to your project's Web Content/WEB-INF/lib directory:
      • commons-*.jar.
      • struts.jar.
    3. Delete the following Tag Library Descriptor (TLD) files from your project's Web Content/WEB-INF directory: struts-*.tld.
    4. Copy the following TLD files from Struts11/WebContent/WEB-INF directory to your project's Web Content/WEB-INF directory: struts-*.tld.

Converting Struts 1.0.2 Web projects to Struts 1.1

In WebSphere Studio V5.1.x (and V5.0.x), when adding Struts support to a Web project you had the option to choose Struts 1.0.2. If you have existing Struts 1.0.2 Web projects and you want to convert them to Struts 1.1, you may convert them manually. (Note: it is not required that you convert Struts 1.1 Beta (2 or 3) projects to Struts 1.1. )

To convert Struts 1.0.2 projects to Struts 1.1, do the following:
  1. Load your Struts 1.0.2 projects into a Rational Application Developer V6.0 workspace.
  2. Create a new Struts 1.1 Web project named, for example, Struts11. You create this temporary project in order to provide convenient access to the Struts 1.1 runtime files you will need while you are converting your real projects. You can delete this project when you are done.
  3. For each Struts 1.0.2 project that you want to convert to Struts 1.1, do the following:
    1. Delete the struts.jar file from your project's Web Content/WEB-INF/lib directory.
    2. Copy the following JAR files from the Struts11/WebContent/WEB-INF/lib directory to your project's Web Content/WEB-INF/lib directory:
      • commons-*.jar.
      • struts.jar.
      • jarkarta-oro.jar.
    3. Delete the following Tag Library Descriptor (TLD) files from your project's Web Content/WEB-INF directory: struts-*.tld.
    4. Copy the following TLD files from Struts11/WebContent/WEB-INF directory to your project's Web Content/WEB-INF directory: struts-*.tld.
Related concepts
Compatibility with WebSphere Studio V5.1.x
Related reference
Debugger changes in V6.0
WDO to SDO migration
EGL reserved words in V6.0
Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.