(originally posted on the WebWork user forum)
I just finished migrating two applications from Webwork 2.2.4 to Struts 2.0.0 and thought I'd share what steps are involved in the process.
DTDs namespaces
XWork was moved under ASF umbrella sometime ago, thus caused change in DOCTYPE, to be compliant with the current version use the latest version available here. Below is presented the wrong DTD:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE xwork PUBLIC "-//OpenSymphony Group//XWork 1.1.1//EN" "http://www.opensymphony.com/xwork/xwork-1.1.1.dtd"> <xwork> ....
The valid one should like this:
<!DOCTYPE xwork PUBLIC "-//Apache Struts//XWork 1.0//EN" "http://struts.apache.org/dtds/xwork-1.1.1.dtd"> <xwork> ....
Package names
Substitute com.opensymphony.webwork
to org.apache.struts2
.
Substitute com.opensymphony.xwork
to com.opensymphony.xwork2
.
Configuration files
Rename webwork.properties
to struts.properties
.
Rename xwork.xml
to struts.xml
.
Change all occurrences of 'webwork' in struts.properties
and struts.xml
to 'struts'.
In web.xml
, change com.opensymphony.webwork.dispatcher.FilterDispatcher
to org.apache.struts2.dispatcher.FilterDispatcher
.
Converters
If you are using converters that subclass WebworkTypeConverter, rename the superclass to StrutsTypeConverter.
JSP's
You have to change the taglib URI: uri="/webwork"
to uri="/struts-tags"
Then you're done!
Well, maybe I've forgotten something but I'll guess you find that out when you try do compile and deploy your application...
2 Comments
Marcos Hernandez
In your JSP's also replace all the <ww:__> tags with <s:__> tags. Remember that some of the WebWork tag properties are deprecated in Struts2.
Marcos Hernandez
In fact in all the JSP's you should replace the entire <%@ taglib prefix="ww" uri="webwork" %> instruction with <%@ taglib prefix="s" uri="struts-tags" %>