Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Struts 2.5 to 6.0.0 migration #1

Open
7 of 19 tasks
timtebeek opened this issue Mar 4, 2024 · 0 comments
Open
7 of 19 tasks

Struts 2.5 to 6.0.0 migration #1

timtebeek opened this issue Mar 4, 2024 · 0 comments
Labels

Comments

@timtebeek
Copy link
Contributor

timtebeek commented Mar 4, 2024

What problem are you trying to solve?

Recipe to migrate to Struts 6.x

  • Upgrade to Java 8
  • Servlet API 3.1
  • Update Struts dependencies to 6.x.x.
    • Remove sitegraph plugin
    • Add Velocity plugin if needed
  • Use a proper DTD header in struts.xml
  • Class changes
    • com.opensymphony.xwork2.config.providers.XmlConfigurationProvider became abstract,
      use org.apache.struts2.config.StrutsXmlConfigurationProvider instead
    • com.opensymphony.xwork2.conversion.TypeConversionException was replaced by org.apache.struts2.conversion.TypeConversionException
    • com.opensymphony.xwork2.XWorkException was replaced by org.apache.struts2.StrutsException
  • XWork constants; see list of removed constants and Struts substitutes
  • New constants struts.i18n.search.defaultbundles.first and struts.ui.escapeHtmlBody
  • Tag escape behaviour
    • After migrating to the latest Freemarker (which enables auto-escaping by default) you should stop using ?html in your custom tags and freemarker based pages.
    • Also when embedding a tag in <s:a>, <s:submit> and <s:component> tags like in the example below:
  • The <s:date/> tag has been adjusted to support a new Java 8 Date/Time API
  • Deprecated interfaces
    • These interfaces have a new proper versions in another package, please start using the new versions as the deprecated interfaces will be removed with the next major release
  • Javatemplate Checkbox tag
    • can introduce a NullPointerException when you will use Boolean or String to hold an unchecked value as submittedUnchecked is set to false by default, which means the unchecked value won't be sent and stored in the action
  • Static methods access
    • It won't be possible to access static methods using OGNL expression, eg. @com.app.Util@makeCode() won't work anymore. If you are still using this approach you must wrap access to static methods with action instance methods or use static field access instead.

Any additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Recipes Wanted
Development

No branches or pull requests

1 participant