Java 8
From this version of Struts, the framework requires Java 8 at least to run.
Servlet API 3.1
Struts 6.0.0 requires a servlet container which supports Servlet API 3.1 at least, it won't work with older versions.
Dependencies
Update Struts dependencies to 6.x.x.
Remove the following plugin dependencies because they were dropped and aren't supported anymore:
Support for Velocity was has been moved into a dedicated pluginsplugin, also Velocity based tags were moved into the new plugin, see
Jira |
---|
server | ASF JIRA |
---|
serverId | 5aa69414-a9e9-3523-82ec-879b028fb15b |
---|
key | WW-5049 |
---|
|
for more details
. Note |
---|
To still use the Velocity plugin in your application you must include the plugin and its JARs plus use a proper parent package in your struts.xml like this: Code Block |
---|
<package name="mystrutsapp" extends="json-default, velocity-default">
...
</package> |
|
DTD
Please use a proper DTD header in struts.xml as demonstrated below:
Code Block |
---|
|
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 6.0//EN"
"https://struts.apache.org/dtds/struts-6.0.dtd"> |
Class changes
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider
became abstract, please use org.apache.struts2.config.StrutsXmlConfigurationProvider
instead.
...
All Xwork constans had been already deprecated, with this version all of them have been removed and Struts constants have been used instead. See tickets
Jira |
---|
server | ASF JIRA |
---|
serverId | 5aa69414-a9e9-3523-82ec-879b028fb15b |
---|
key | WW-4792 |
---|
|
and
Jira |
---|
server | ASF JIRA |
---|
serverId | 5aa69414-a9e9-3523-82ec-879b028fb15b |
---|
key | WW-5000 |
---|
|
with the linked PRs for the exact changes. Below is a list of removed constants and Struts
substitutesubstitutes:
Old constant | New constant |
---|
collectionConverter | struts.converter.collection |
dateConverter | struts.converter.date |
numberConverter | struts.converter.number |
stringConverter | struts.converter.string |
arrayConverter | struts.converter.array |
devMode | struts.devMode |
logMissingProperties | struts.ognl.logMissingProperties |
enableOGNLExpressionCache | struts.ognl.enableExpressionCache |
enableOGNLEvalExpression | struts.ognl.enableEvalExpression |
reloadXmlConfiguration | struts.configuration.xml.reload |
allowStaticMethodAccess | struts.ognl.allowStaticMethodAccess |
xwork.loggerFactory | <not used any more> |
ognlExcludedClasses | struts.excludedClasses |
ognlExcludedPackageNamePatterns | struts.excludedPackageNamePatterns |
ognlExcludedPackageNames | struts.excludedPackageNames |
additionalExcludedPatterns | struts.additional.excludedPatterns |
additionalAcceptedPatterns | struts.additional.acceptedPatterns |
overrideExcludedPatterns | struts.override.excludedPatterns |
overrideAcceptedPatterns | struts.override.acceptedPatterns |
struts.xwork.chaining.copyErrors | struts.chaining.copyErrors |
struts.xwork.chaining.copyFieldErrors | struts.chaining.copyFieldErrors |
struts.xwork.chaining.copyMessages | struts.chaining.copyMessages |
xwork.autoGrowCollectionLimit | struts.ognl.autoGrowthCollectionLimit |
objectFactory.classloader | struts.objectFactory.classloader |
...
A set of action related interfaces have been marked as deprecated. These interfaces have a new proper versions in another package, please start using the new versions as the depretacted interfaces will be removed with the next major release.
Deprecated | New version |
---|
org.apache.struts2.interceptor.ApplicationAware | org.apache.struts2.action.ApplicationAware |
org.apache.struts2.interceptor.CookiesAware | org.apache.struts2.action.CookiesAware |
org.apache.struts2.interceptor.HttpParametersAware | org.apache.struts2.action.ParametersAware |
org.apache.struts2.interceptor.ParameterAware | org.apache.struts2.action.ParametersAware |
org.apache.struts2.interceptor.PrincipalAware | org.apache.struts2.action.PrincipalAware |
org.apache.struts2.interceptor.RequestAware | org.apache.struts2.action.ServletRequestAware |
org.apache.struts2.interceptor.ServletRequestAware | org.apache.struts2.action.ServletRequestAware |
org.apache.struts2.interceptor.ServletResponseAware | org.apache.struts2.action.ServletResponseAware |
org.apache.struts2.interceptor.SessionAware | org.apache.struts2.action.SessionAware |
org.apache.struts2.util.ServletContextAware | org.apache.struts2.action.ServletContextAware |
See
Jira |
---|
server | ASF JIRA |
---|
serverId | 5aa69414-a9e9-3523-82ec-879b028fb15b |
---|
key | WW-4963 |
---|
|
for more details
.Javatemplate Checkbox tag
Javatemplate Checkbox tag implementation had been missing support for submitUnchecked
attribute. This has been fixed yet it 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, see
Jira |
---|
server | ASF JIRA |
---|
serverId | 5aa69414-a9e9-3523-82ec-879b028fb15b |
---|
key | WW-5168 |
---|
|
for more details.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.
Temp/Work directory of ApplicationServer/ServletContainer
...