Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added logging issues
Info
titleAbout the Migration guide

This guide describes how to migrate an existing Struts 2.0.x application to Struts 2.1.x. It is intended to be read from top to bottom but you may skip-ahead to known problems and common exceptions. Please edit this page or provide comments if you encounter additional issues.

Table of Content:

Table of Contents
minLevel2
maxLevel23
indent0px2em

Update Dependencies

Update your project dependences to use struts2-core-2.1.x and the plugins struts2-core-2.1.x.

...

Maven users can update their project's pom.xml to reference the new core and plugin versions.
Ensure maven is configured to use the appropriate repository. Non-GA releases are usually available in a staging repository:

Code Block
 <repositories>
    <repository>
      <id>struts2.1.1-staging</id>
      <name>Struts 2.1.1 staging repository</name>
      <layout>default</layout>
      <url>http://people.apache.org/builds/struts/2.1.1/m2-staging-repository/</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>

Non-Maven users can can download the jars and dependencies in a Distribution 2.1.1

Update struts.xml Configuration

Results and Interceptors have been renamed to use camelCase instead of hyphenated names (eg. now redirectAction instead of redirect-action).
Review all custom interceptor stacks, interceptor refs and results in struts.xml and remove the hyphen.

Interceptors:

From

To

external-ref

externalRef

model-driven

modelDriven

static-params

staticParams

scoped-model-driven

scopedModelDriven

servlet-config

servletConfig

token-session

tokenSession

Results:

From

To

redirect-action

redirectAction

plaintext

plainText

Note

DELETE OLD VERSIONS NOW: It's essential that old versions of the jars are removed from your project as well as the deployment directories. Don't trust your IDE to delete unused versions.
eg. Your application is now be dependent on xwork-2.1.x, not xwork-2.0.x. Ensure xwork-2.0.x is completely removed or you will encounter compile-time and run-time exceptions.

Update Custom Type Converters

If your project implements custom type converters you may need to change the imports statements to use the com.opensymphony.xwork2.conversion package. Failing to do so will cause a compile-time error.

Before:

Code Block

import com.opensymphony.xwork2.util.TypeConversionException;

After:

Code Block

import com.opensymphony.xwork2.conversion.TypeConversionException;

Update struts.xml Configuration

Results and Interceptors have been renamed to use camelCase instead of hyphenated names (eg. now redirectAction instead of redirect-action).
Review all custom interceptor stacks, interceptor refs and results in struts.xml and remove the hyphen.

Interceptors:

From

To

external-ref

externalRef

model-driven

modelDriven

static-params

staticParams

scoped-model-driven

scopedModelDriven

servlet-config

servletConfig

token-session

tokenSession

Results:

From

To

redirect-action

redirectAction

plaintext

plainText

Note

Forgetting to rename an interceptor or result reference will prevent your WebApp from starting. The following is a typical stacktrace for an invalid result type.

Code Block

SEVERE: Exception starting filter struts2
Unable to load configuration. - action - file:/home/giaz/code/.metadata/.plugins/
            com.genuitec.eclipse.easie.tomcat.myeclipse/tomcat/webapps/
Note

Forgetting to rename an interceptor or result reference will prevent your WebApp from starting. The following is a typical stacktrace for an invalid result type.

Code Block

SEVERE: Exception starting filter struts2
Unable to load configuration. - action - file:/home/giaz/code/.metadata/.plugins/
            com.genuitec.eclipse.easie.tomcat.myeclipse/tomcat/webapps/webui/WEB-INF/classes/struts.xml:39:98
	at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
	at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:370)
...
Caused by: Error building results for action ScheduleJob in namespace  - action - file:/home/giaz/code/.metadata/.plugins/
             com.genuitec.eclipse.easie.tomcat.myeclipse/tomcat/webapps/webui/WEB-INF/classes/struts.xml:39:98
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:372)
	... 30 more
Caused by: There is no result type defined for type 'redirect-action' mapped with name 'success' - result -

...

1. Add the Dojo plugin as a new dependency for your project

Code Block
    <dependency>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts2-dojo-plugin</artifactId>
        <version>2.1.1</version>
    </dependency>

2. Modify ALL pages that use the ajax theme to reference use the additional Dojo tag library.

Note

If this is a major task, it is recommended to modify and test or validate each page one at a time.

...

Reference the new taglib in your JSP or FTL pages.
Before

Code Block
xml
xml
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags"%> 

After

Code Block
xml
xml
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags"%> 
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>

...

Review the new attributes of the new head tag. You need to decide which values for the cache, compressed, parseContent and extraLocales attributes are appropriate for your application. These settings have major performance implications.

Before:

Code Block
xml
xml
<s:head theme="ajax"/>

After:

Code Block
xml
xml
<sx:head parseContent="true"/>

...

Some tags are available only in the Dojo plugin taglib. It will be immediately obvious from your IDE that these tags need to change to the sx: prefix.
Some tags are available in both the core and Dojo plugin taglibs. Any tag that uses the ajax theme needs to be changed to the sx: prefix.

Before:

Code Block
xml
xml
<s:url id="jobStatus" includeParams="get" value="/RefreshOptimizationJobStatus.action" />
<s:div id="jobStatus" theme="ajax" href="%{jobStatus}" updateFreq="5000" indicator="indicator">
</s:div>
<img id="indicator" src="img/indicator.gif" alt="Loading..." style="display:none"/>

After:

Code Block
xml
xml


<s:url var="jobStatus" includeParams="get" value="/RefreshOptimizationJobStatus.action" />
<sx:div id="jobStatus" href="%{#jobStatus}" updateFreq="5000" autoStart="true" indicator="indicator">
</sx:div>
<img id="indicator" src="img/indicator.gif" alt="Loading..." style="display:none"/>

Sitemesh

No known migration issues

Jasper Reports

No known migration issues

Specific Migration issues and resolutions

The issues are listed in the same order as encountered after changing jars over from 2.0.x to 2.1.x. Noteworthy, the migration was done under the following setup: Fedora core 6, JDK 1.6.0_2 and Tomcat 6.0.10 running from MyEclipse plugin.

Result type "redirect-action" was renamed to "redirectAction":

Problem Symptom:

Code Block

SEVERE: Exception starting filter struts2
Unable to load configuration. - action - file:/home/giaz/code/.metadata/.plugins/
            com.genuitec.eclipse.easie.tomcat.myeclipse/tomcat/webapps/webui/WEB-INF/classes/struts.xml:39:98
	at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
	at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:370)
...
Caused by: Error building results for action ScheduleJob in namespace  - action - file:/home/giaz/code/.metadata/.plugins/
             com.genuitec.eclipse.easie.tomcat.myeclipse/tomcat/webapps/webui/WEB-INF/classes/struts.xml:39:98
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:372)
	... 30 more
Caused by: There is no result type defined for type 'redirect-action' mapped with name 'success' - result -
              file:/home/giaz/code/.metadata/.plugins/com.genuitec.eclipse.easie.tomcat.myeclipse/tomcat/webapps/webui/
              WEB-INF/classes/struts.xml:40:50
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.buildResults(XmlConfigurationProvider.java:616)
	... 35 more

The struts.xml before:

Code Block

<action name="ScheduleJob" class="com.sag.optimizer.ui.web.action.scheduler.ScheduleJobAction">
  <result name="success" type="redirect-action">
     <param name="actionName">ListDisplayOptimizationJobStatus</param>
  </result>
  <result name="error" type="tiles">webui.requestFailed</result>
</action>

To resolve this issue modify the struts.xml action definition to:

Code Block

<action name="ScheduleJob" class="com.sag.optimizer.ui.web.action.scheduler.ScheduleJobAction">
  <result name="success" type="redirectAction">
     <param name="actionName">ListDisplayOptimizationJobStatus</param>
  </result>
  <result name="error" type="tiles">webui.requestFailed</result>
</action>

or to:

Code Block

<action name="ScheduleJob" class="com.sag.optimizer.ui.web.action.scheduler.ScheduleJobAction">
  <result name="success" type="redirect">ListDisplayOptimizationJobStatus.action</result>
  <result name="error" type="tiles">webui.requestFailed</result>
</action>

Tiles 2.1.x plugin tiles.xml now requires DOCTYPE:

Problem Symptom:

Code Block

Nov 22, 2007 11:38:11 AM org.apache.tiles.impl.BasicTilesContainer init
INFO: Initializing Tiles2 container. . .
Nov 22, 2007 11:38:11 AM org.apache.commons.digester.Digester error
SEVERE: Parse Error at line 2 column 19: Document is invalid: no grammar found.
org.xml.sax.SAXParseException: Document is invalid: no grammar found.
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
Info
titleReason for this

This is due to the fact that Tiles 2.0.5 now turns validation on as default.

The tiles.xml page before:

Code Block

<?xml version="1.0" encoding="ISO-8859-1" ?>
<tiles-definitions/>

To resolve the issue simply add:

Code Block

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE tiles-definitions PUBLIC
	"-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
	"http://struts.apache.org/dtds/tiles-config_2_0.dtd">
<tiles-definitions/>

<s:head theme="ajax"/> is obsolete, use a different theme:

Problem Symptom: Accessing any page that includes <s:head theme="ajax"/> produces the following error:

Code Block

Nov 22, 2007 1:54:51 PM freemarker.log.JDK14LoggerFactory$JDK14Logger error
SEVERE:

Expression parameters.parseContent is undefined on line 45, column 28 in template/ajax/head.ftl.
The problematic instruction:
----------
==> ${parameters.parseContent?string} [on line 45, column 26 in template/ajax/head.ftl]
----------

Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression parameters.parseContent is undefined on line 45,
            column 28 in template/ajax/head.ftl.
	at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
	at freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:134)

Resolution is to either remove the "<s:head theme="ajax"/>" or use a different theme e.g. <s:head theme="xhtml" />

Ajax UI tags were moved to the new dojo plugin, use /struts-dojo-tags taglib instead of (or in addition to) /struts-tags:

Problem Symptom: Accessing a page containing ajax UI tags through using the struts 2 taglib will produce the following error:

Code Block

SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /jsp/list/listOptimizationJobStatus.jsp(6,0) Attribute href invalid for tag div according to TLD
	at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
	at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)

JSP before migration:

Code Block

<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="display" uri="http://displaytag.sf.net" %>
<%@ taglib prefix="s" uri="/struts-tags"%>

<s:url id="jobStatus" includeParams="get" value="/RefreshOptimizationJobStatus.action" />
<s:div id="jobStatus" theme="ajax" href="%{jobStatus}" updateFreq="5000" indicator="indicator">
</s:div>
<img id="indicator" src="img/indicator.gif" alt="Loading..." style="display:none"/>

Resolution is to import and use struts-dojo-tags plugin instead:

Code Block

<%@ page contentType="text/html; charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>

<s:url var="jobStatus" includeParams="get" value="/RefreshOptimizationJobStatus.action" />
<sx:div id="jobStatus" href="%{#jobStatus}" updateFreq="5000" autoStart="true" indicator="indicator">
</sx:div>
<img id="indicator" src="img/indicator.gif" alt="Loading..." style="display:none"/>
Info
titleOther Ajax UI tags were also moved to the dojo plugin

Note the use of remote div is now through the dojo plugin taglib sx. Other ui tags are also no longer available through the /struts-tags taglib but only through the /struts-dojo-tags taglib: datetimepicker and autocompleter.

User-defined converter (subclassing StrutsTypeConverter) will no longer be needed when using datetimepicker:

Problem Symptom: Your custom StrutsTypeConverter implementation does not longer work in version 2.1.x. In 2.0.x you needed to implement a custom StrutsTypeConverter e.g. StringToDateConverter to be able to parse and convert to Date the String posted from a datetimepicker control into the action. In version 2.0.x datetimepicker was posting a String formatted as specified in the "displayFormat" field e.g.

Code Block

<%@ taglib prefix="s" uri="/struts-tags"%>

<s:datetimepicker label="Begin Date" name="beginDate" displayFormat="yyyy.MM.dd">

In version 2.1.x datetimepicker will post a String Date in RFC 3339 format, so you can define your setter to receive a Date directly and avoid using converters for this purpose e.g.

Code Block

<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>

<sx:datetimepicker label="Begin Date" name="beginDate" displayFormat="yyyy.MM.dd">

Need to disable struts.devMode. This is not really a migration issue but rather seems a bug in 2.1.x:

Problem Symptom: You receive the following exception accessing a page:

Code Block

WARNING: Could not find property [struts.valueStack]
ognl.OgnlException: target is null for setProperty(null, "preventCache", [Ljava.lang.String;@5f262a85)
   at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1651)
   at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
   at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
   at ognl.SimpleNode.setValue(SimpleNode.java:246)
   at ognl.ASTChain.setValueBody(ASTChain.java:172)

Resolution is to change set devMode to false in struts.xml e.g. from

Code Block

<constant name="struts.devMode" value="true" />

to

...

Note

If you forget to migrate a tag reference from the core to the dojo plugin you will receive an exception similar to the one below:

Code Block
none
none

2008-04-19 14:32:30,475 ERROR [http-8443-Processor23] [[jsp]] Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: No tag "datetimepicker" defined in tag library imported with prefix "s"

Reduce verbose logging

Struts 2.1 introduces more verbose logging than Struts 2.0. While extremely valuable, some users may find these annoying.

Missing Properties

This message states that the framework searched for a property in the value stack and failed to find it.

Code Block
none
none

2008-04-19 14:21:08,177 WARN  [http-8443-Processor25] [OgnlValueStack] Could not find property [templateDir]
2008-04-19 14:21:08,177 WARN  [http-8443-Processor25] [OgnlValueStack] Could not find property [templateDir]
2008-04-19 14:21:08,177 WARN  [http-8443-Processor25] [OgnlValueStack] Could not find property [templateDir]
2008-04-19 14:21:08,178 WARN  [http-8443-Processor25] [OgnlValueStack] Could not find property [org.apache.catalina.jsp_file]

To hide these messages, turn off the WARN level logging for OgnlValueStack.

eg. Include a new limit category in your log4j.xml file (only log errors or worse):

Code Block
xml
xml

<category name="com.opensymphony.xwork2.ognl.OgnlValueStack">
      <priority value="error"/>
   </category>

TextProvider missing keys

These messages state that the framework searched for text in a resource bundle and failed to find it.

Code Block
none
none

2008-04-19 14:32:30,106 WARN  [http-8443-Processor23] [TextProviderHelper] The first TextProvider in the ValueStack 
(package.Action) could not locate the message resource with key 'companyDetails.addressId'
2008-04-19 14:32:30,107 WARN  [http-8443-Processor23] [TextProviderHelper] The default value expression 
'companyDetails.addressId' evaluated to '10'

To hide those messages, turn off the WARN level logging for TextProviderHelper.

eg. Include a new limit category in your log4j.xml file (only log errors or worse):

Code Block
xml
xml

<category name="org.apache.struts2.util.TextProviderHelper">
      <priority value="error"/>
   </category>

Update Unit Tests

There are two known major migration issues affecting user's unit tests.

  • The Configuration API now uses a Builder pattern
  • The ActionContext.getContext() method does not create a context on demand.

Review the Unit Tests included with Struts2 for recommended practices to setup the Configuration and context.

Other migration issues and resolutions

The issues are listed in the same order as encountered after changing jars over from 2.0.x to 2.1.x. Noteworthy, the migration was done under the following setup: Fedora core 6, JDK 1.6.0_2 and Tomcat 6.0.10 running from MyEclipse plugin.

Result type "redirect-action" was renamed to "redirectAction":

Code Block

SEVERE: Exception starting filter struts2
Unable to load configuration. - action - file:/home/giaz/code/.metadata/.plugins/
            com.genuitec.eclipse.easie.tomcat.myeclipse/tomcat/webapps/webui/WEB-INF/classes/struts.xml:39:98
	at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
	at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:370)
...
Caused by: Error building results for action ScheduleJob in namespace  - action - file:/home/giaz/code/.metadata/.plugins/
             com.genuitec.eclipse.easie.tomcat.myeclipse/tomcat/webapps/webui/WEB-INF/classes/struts.xml:39:98
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:372)
	... 30 more
Caused by: There is no result type defined for type 'redirect-action' mapped with name 'success' - result -
              file:/home/giaz/code/.metadata/.plugins/com.genuitec.eclipse.easie.tomcat.myeclipse/tomcat/webapps/webui/
              WEB-INF/classes/struts.xml:40:50
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.buildResults(XmlConfigurationProvider.java:616)
	... 35 more

The struts.xml before:

Code Block

<action name="ScheduleJob" class="com.sag.optimizer.ui.web.action.scheduler.ScheduleJobAction">
  <result name="success" type="redirect-action">
     <param name="actionName">ListDisplayOptimizationJobStatus</param>
  </result>
  <result name="error" type="tiles">webui.requestFailed</result>
</action>

To resolve this issue modify the struts.xml action definition to:

Code Block

<action name="ScheduleJob" class="com.sag.optimizer.ui.web.action.scheduler.ScheduleJobAction">
  <result name="success" type="redirectAction">
     <param name="actionName">ListDisplayOptimizationJobStatus</param>
  </result>
  <result name="error" type="tiles">webui.requestFailed</result>
</action>

or to:

Code Block

<action name="ScheduleJob" class="com.sag.optimizer.ui.web.action.scheduler.ScheduleJobAction">
  <result name="success" type="redirect">ListDisplayOptimizationJobStatus.action</result>
  <result name="error" type="tiles">webui.requestFailed</result>
</action>

Tiles 2.1.x plugin tiles.xml now requires DOCTYPE:

Problem Symptom:

Code Block

Nov 22, 2007 11:38:11 AM org.apache.tiles.impl.BasicTilesContainer init
INFO: Initializing Tiles2 container. . .
Nov 22, 2007 11:38:11 AM org.apache.commons.digester.Digester error
SEVERE: Parse Error at line 2 column 19: Document is invalid: no grammar found.
org.xml.sax.SAXParseException: Document is invalid: no grammar found.
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
Info
titleReason for this

This is due to the fact that Tiles 2.0.5 now turns validation on as default.

The tiles.xml page before:

Code Block

<?xml version="1.0" encoding="ISO-8859-1" ?>
<tiles-definitions/>

To resolve the issue simply add:

Code Block

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE tiles-definitions PUBLIC
	"-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
	"http://struts.apache.org/dtds/tiles-config_2_0.dtd">
<tiles-definitions/>

<s:head theme="ajax"/> is obsolete, use a different theme:

Problem Symptom: Accessing any page that includes <s:head theme="ajax"/> produces the following error:

Code Block

Nov 22, 2007 1:54:51 PM freemarker.log.JDK14LoggerFactory$JDK14Logger error
SEVERE:

Expression parameters.parseContent is undefined on line 45, column 28 in template/ajax/head.ftl.
The problematic instruction:
----------
==> ${parameters.parseContent?string} [on line 45, column 26 in template/ajax/head.ftl]
----------

Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression parameters.parseContent is undefined on line 45,
            column 28 in template/ajax/head.ftl.
	at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
	at freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:134)

Resolution is to either remove the "<s:head theme="ajax"/>" or use a different theme e.g. <s:head theme="xhtml" />

Ajax UI tags were moved to the new dojo plugin, use /struts-dojo-tags taglib instead of (or in addition to) /struts-tags:

Problem Symptom: Accessing a page containing ajax UI tags through using the struts 2 taglib will produce the following error:

Code Block

SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /jsp/list/listOptimizationJobStatus.jsp(6,0) Attribute href invalid for tag div according to TLD
	at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
	at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)

JSP before migration:

Code Block

<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="display" uri="http://displaytag.sf.net" %>
<%@ taglib prefix="s" uri="/struts-tags"%>

<s:url id="jobStatus" includeParams="get" value="/RefreshOptimizationJobStatus.action" />
<s:div id="jobStatus" theme="ajax" href="%{jobStatus}" updateFreq="5000" indicator="indicator">
</s:div>
<img id="indicator" src="img/indicator.gif" alt="Loading..." style="display:none"/>

Resolution is to import and use struts-dojo-tags plugin instead:

Code Block

<%@ page contentType="text/html; charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>

<s:url var="jobStatus" includeParams="get" value="/RefreshOptimizationJobStatus.action" />
<sx:div id="jobStatus" href="%{#jobStatus}" updateFreq="5000" autoStart="true" indicator="indicator">
</sx:div>
<img id="indicator" src="img/indicator.gif" alt="Loading..." style="display:none"/>
Info
titleOther Ajax UI tags were also moved to the dojo plugin

Note the use of remote div is now through the dojo plugin taglib sx. Other ui tags are also no longer available through the /struts-tags taglib but only through the /struts-dojo-tags taglib: datetimepicker and autocompleter.

User-defined converter (subclassing StrutsTypeConverter) will no longer be needed when using datetimepicker:

Problem Symptom: Your custom StrutsTypeConverter implementation does not longer work in version 2.1.x. In 2.0.x you needed to implement a custom StrutsTypeConverter e.g. StringToDateConverter to be able to parse and convert to Date the String posted from a datetimepicker control into the action. In version 2.0.x datetimepicker was posting a String formatted as specified in the "displayFormat" field e.g.

Code Block

<%@ taglib prefix="s" uri="/struts-tags"%>

<s:datetimepicker label="Begin Date" name="beginDate" displayFormat="yyyy.MM.dd">

In version 2.1.x datetimepicker will post a String Date in RFC 3339 format, so you can define your setter to receive a Date directly and avoid using converters for this purpose e.g.

Code Block

<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>

<sx:datetimepicker label="Begin Date" name="beginDate" displayFormat="yyyy.MM.dd">

...

h4 ActionMappingParams


Parameters set by the action mapping are not set/not available through ParameterAware (This change is only needed when going to 2.1.x (where x>0))

These are now only available if you use the new interceptor named "actionMappingParams".