Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-2585

Struts not populating form values when maxFileSize exceeded during file upload

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.2.7
    • 1.4.x
    • Core
    • None
    • Operating System: other
      Platform: All
    • 36687

    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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              lmg@yahoo.com lmg
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: