This document covers a step-by-step guide for upgrading to WebWork 2.2 from 2.1.x, as well as a list of the key individual changes for reference.

Upgrade Guide

  1. Get the latest 2.2 release
  2. Check out the dependencies to see what the required libraries are. One change of note is the dependency on Rife-Continuations. Click through the tabs for the dependencies for different usage profiles. If you use FreeMarker for instance, click on that tab to see those dependencies. Note that if you use the JSP tags you are now using FreeMarker by default for the UI component templates.
  3. Check the Individual Changes section below to see if any of those changes affect your code
  4. Update to use the FilterDispatcher instead of the ServletDispatcher. Check out the web.xml 2.1.x compatibility page for some compatibility discussions, and see web.xml for what needs to go in the web.xml file.

Deprecated Items

  • The ServletDispatcher is now deprecated, please use the FilterDispatcher if possible. See web.xml 2.1.x compatibility for more information about potential problems you might have when switching to FilterDispatcher.
  • The Velocity and FreeMarker servlets are no longer supported. We highly recommend you don't use these servlets but rather the FreeMarker Result or Velocity Result directly.
  • If you were using JSP tags within Velocity, this is no longer supported and will soon be removed. You can use the instructions explained in web.xml 2.1.x compatibility to get along for now, but we highly recommend using the new native Velocity tag support provided by WebWork.
  • The table tag is now considered deprecated. We may undeprecate it in the future if more time can be invested, but we recommend that you look at alternative options such as Display Tag.
  • All support for including actions (using the include tag or jsp:include) is no longer available when using the FilterDispatcher. We recommend you use the action tag instead.
  • The cos and pell file upload parsers are no longer actively maintained and will be deleted soon. We highly recommend you use the Jakarta file upload parser, which is now the default parser.

Deleted Items

  • All VoiceXML tags have been removed from WebWork.
  • The Velocity-based Tags have been removed. If you were using or extending these tags (advanced users typically), you can copy them from the /template/archive directory in the webwork jar.

Individual Changes

Version Description Old Code New Code
2.1.x If you implemented your own ObjectFactory or ActionInvocation classes, you will notice that there have been some minor changes to make an "extraContext" Map available for the build* methods. This allows, for instance, access to the Session map during object creation, even before the ActionContext ThreadLocal has been set. ObjectFactory.getObjectFactory().buildBean(clazz); ObjectFactory.getObjectFactory().buildBean(clazz, extraContext);
2.0+ If you've used the WebWork base classes for building templated tags, you'll run into the refactoring of the UI tags to use common Component classes as the templated back-end. The tags now use these Component classes, as do Velocity and FreeMarker. This allows Velocity and FreeMarker to use the same UI components directly, without pretending to be a JSP page, but it also means you need to refactor your custom tags to use the new API's ...your code.. See the existing UI tags in the 2.2 source
2.1.x If you were not using the Alt Syntax, it is now enabled by default. You can either upgrade or change the Tag Syntax <ww:url value="'http://www.yahoo.com'"/> <ww:url value="http://www.yahoo.com"/>
2.1.x If you are using FreeMarker and your code uses psuedo properties on collections and maps, you need to modify the code to call methods instead. ${parameters?size} / ${parameters.size?html} ${parameters.size()} / ${parameters.get("size")?html}
2.1.x The defaultStack has been renamed to the basicStack. <interceptor-ref name="defaultStack"/> <interceptor-ref name="basicStack"/>
2.1.x The completeStack has been renamed to the defaultStack. <interceptor-ref name="completeStack"/> <interceptor-ref name="defaultStack"/>
2.1.x The defaultStack (previously the completeStack) is now the default interceptor stack in webwork-default.xml. In addition, this stack now configures the Workflow Interceptor and the Validation Interceptor to not run if the method names are input, back, or cancel N/A N/A
2.1.x The component interceptor has been deprecated (along with all WebWork IOC features) and has been removed from the basicStack and completeStack. You'll need to add it back by hand if you wish to use this deprecated feature. N/A N/A
2.0+ The include tag's page attribute has been deprecated since 1.x and is now removed from 2.2. Please use the value attribute. <ww:include page="..."/> <ww:include value="..."/>
2.0+ The text tag's value0, value1, value2, and value 3attributes have been deprecated since 1.x and are now removed from 2.2. Please use the param tag instead. <ww:text value0="...""/> <ww:text><ww:param value="someValue">...</ww:param></ww:text>
2.0+ The session map wrapper (found in ActionContext) has been changed to no longer create sessions for every request. If your application depends on sessions being automatically created, WebWork 2.2 no longer does that. Instead, you must create the session yourself or the session will be created as soon as a value is put in the session Map. N/A N/A
2.0+ The VUI tags have been removed from WebWork. They haven't been actively worked on in over 4 years and are not used in the community. N/A N/A
2.0+ The URI of the WebWork TLD was change from webwork to /webwork. If you were already using the packaged TLD from webwork.jar, you will have to adjust URI in your JSPs <%@ taglib uri="webwork" prefix="ww" %> <%@ taglib uri="/webwork" prefix="ww" %>
2.0+ The default encoding has changed from ISO-8859-1 to UTF-8. If you wish to continue to use ISO-8859-1, you must change your webwork.properties. N/A webwork.i18n.encoding=ISO-8859-1