I managed to trace the source of the duplicate message. Basically, the
new error message shortcuts to calling "input" on my action.
.....I have a hidden field to check to make sure the upload is from my
form, and then I have an interceptor that checks the value and if
invalid calls input on my action, to show an error message.
<s:form id="uploadFiles" action="myUpload" method="POST"
enctype="multipart/form-data">
<s:hidden name="ckeckme" />
<s:form
The interceptor (extends MethodFilterInterceptor) adds an error:
theAction.addError("error.permissions.deniedCheck");
and then returns "input"
The input is a chain in my case (as I use list as the screen default,
tiles). If I change the input to tiles I get one message.
<action name="myUpload!*" method="{1}" class="my.Upload">
<!-- input for security check -->
<result name="input" type="chain">myUpload</result>
<result name="list" type="tiles">.MyUpload</result>
</action>
These seems to be some difference in the error flow, as the max file
size logic calls my execute, whilst the zero file size check shortcuts
to input, and then gets picked up by the workflow and adds the extra
message. For me.
I will experiment with changing my input to tiles and see what happens.
On 04/10/2025 09:54, Lukasz Lenart wrote:
I tested the empty file upload behaviour using the example app
https://github.com/apache/struts-examples/tree/main/file-upload
It uses single <s:actionerror/> tag and based on struts-default
package, and I get single error message:
File zero.txt for field upload is empty (0 bytes). Empty file uploads are not
allowed.
I assume you have used a custom interceptor stack (as you have
mentioned early) and that was the cause.
Cheers
Łukasz
---------------------------------------------------------------------
To unsubscribe, e-mail:[email protected]
For additional commands, e-mail:[email protected]