Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Started converting into a migration guide

...

Table of Contents
minLevel2
maxLevel2
indent0px

Dependencies

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

Info

There have been significant changes to the Configuration API between 2.0 and 2.1. Third-party plugins for 2.0 may not be compatible with 2.1.

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 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/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 -

Migrate plugin configuration

Tiles

Dojo

Migration issue/resolutions

...