In my struts.xml I have:
<action name="file_save" method="fileSave" class="FileActionBean">
<interceptor-ref name="fileUpload">
<param name="maximumSize">
5242880
</param>
<param name="allowedTypes">
text/html
</param>
</interceptor-ref>
<interceptor-ref name="defaultStack"></interceptor-ref>
<result name="success" type="redirect">file</result>
<result name="error">error</result>
</action>
When I upload a file that’s bigger than 5MB then no error is thrown. Then at the top of my struts.xml I have:
<constant name="struts.multipart.maxSize" value="20971520" />
Now when I upload a file that’s bigger than 20MB then an error message is shown. Is this normal behaviour?
If so, how can I configure struts to show error messages for interceptors too?
EDIT 1:
I’m using struts 2 version 2.1.8.1
I had a similar problem in this post:
How do you override Struts 2 Messages?
I found that by following this example I resolved both this issue and the one above.