Details
Description
During a file upload, RequestUtils.java detects when the maximum file size is
exceeded and terminates form population when this condition is present. Since
file upload processing occurs before populating other non-file form elements the
resulting form does not contain data for non-file form elements. This causes
problems when these other form elements are assigned validators. After calling
processPopulate(), RequestProcessor.java calls processValidate() to validate the
form and finds null values for the non-file form elements. In my case I have the
"required" validator assigned to a number of form elements which fails because
the form elements have not been populated even though they are present in the
request. The end user is presented with the "required" error message masking the
true problem of the max file size being exceeded.
I am aware of the MultipartRequesthandler.ATTRIBUTE_MAX_LENGTH_EXCEEDED
attribute that is added to the request when the max file size has been exceeded
but because validation fails the action is never executed and there is no
opportunity to correct the unwanted behavior described above.
I suggest allowing the form elements to be populated when the max file size has
been exceeded so that form validation can proceed as normal.