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:
- Open the Struts Web project in the Project Explorer.
- Double-click the Web project's Web Deployment Descriptor file
in the Project Explorer. The Web deployment descriptor editor opens.
- Click the Source tab to open the Source page.
- 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> .
- 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:
- Load your Struts 1.1 Beta projects into a Rational Application
Developer V6.0
workspace.
- 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.
- For each Struts 1.1 Beta project that you want to convert to Struts 1.1,
do the following:
- Delete the following JAR files from your project's Web Content/WEB-INF/lib
directory:
- commons-*.jar.
- struts.jar.
- 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.
- Delete the following Tag Library Descriptor (TLD) files from your project's
Web Content/WEB-INF directory: struts-*.tld.
- 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:
- Load your Struts 1.0.2 projects into a Rational Application
Developer V6.0
workspace.
- 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.
- For each Struts 1.0.2 project that you want to convert to Struts 1.1,
do the following:
- Delete the struts.jar file from your project's Web Content/WEB-INF/lib
directory.
- 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.
- Delete the following Tag Library Descriptor (TLD) files from your project's
Web Content/WEB-INF directory: struts-*.tld.
- Copy the following TLD files from Struts11/WebContent/WEB-INF directory
to your project's Web Content/WEB-INF directory: struts-*.tld.