nikos dimitrakas created WW-5751:
------------------------------------
Summary: null can no longer be passed as parameter to interceptor
Key: WW-5751
URL: https://issues.apache.org/jira/browse/WW-5751
Project: Struts 2
Issue Type: Bug
Components: Core Interceptors
Affects Versions: 7.3.0
Reporter: nikos dimitrakas
Upgrading from 7.2.1 to 7.3.0 seems to have made a change so that null cannot
be passed as a parameter to the ActionFileUploadInterceptor.
I have an interceptor like this:
{code:java}
<interceptor name="myFileUpload"
class="org.apache.struts2.interceptor.ActionFileUploadInterceptor">
<param name="maximumSize">128000000</param>
</interceptor>{code}
That interceptor is then included in a global interceptor stack called
myFileUploadStack.
Later in some specific actions I want to set the maximumSize to null (no limit)
and I do this:
{code:java}
<interceptor-ref name="myFileUploadStack">
<param name="myFileUpload.maximumSize">null</param>
</interceptor-ref>{code}
This used to work until 7.2.1, but in 7.3.0 it gives an error:
The upload validation policy could not be resolved, rejecting the file: file
"test.pdf"; unresolved parameters: maximumSize
Looking at the code and the release notes of 7.3.0, I can find that this
probably relates to the changes made in WithLazyParams.java and
AbstractFileUploadInterceptor.java (using a policy) as part of WW-5659. But I
do not see in the release notes anything about this being intended or what the
migration path would be. The javadoc of WithLazyParams.resolveInto() mentions
null and empty value becoming unresolved, but not what to do about it.
Obviously, I can set a very large number or create a second interceptor and
interceptorStack to get around this, but I felt that this should be reported so
that either it can be fixed, or it can be confirmed as the intended behaviour
and if so, perhaps write something about it in the release notes (under
Breaking changes) or in a migration guide.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)