Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-3075

AJAX file upload fails in IE8 due to Wicket.Ajax.handleMultipart() sniffing wicket:body tags as an HTML body element when running Wicket in development mode

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.4.10
    • 1.4.13, 1.5-M3
    • wicket
    • None

    Description

      To reproduce:

      1. Run provided quickstart project
      2. Open in IE8.
      3. Upload a file.

      Expected behaviour:

      File is uploaded, and some basic information about uploaded file is displayed.

      Observed behaviour:

      IllegalStateException is thrown.

      The IllegalStateException is being thrown because the form is being submitted as a normal form. This is because the JS in handleMultipart that traverses up the DOM looking for the actual form is checking tagnames, and in IE8, the tagName of a <wicket:body> is body, so as soon as it hits a wicket:body, it returns false. I've provided a patch that checks for identity against document.body - an alternative is to check that the form.tagUrn is empty, as it would be for a normal HTML element.

      Attachments

        1. reproduction_body_bug.zip
          22 kB
          Liam Clarke-Hutchinson
        2. bodySniffing.patch
          0.4 kB
          Liam Clarke-Hutchinson

        Activity

          People

            mgrigorov Martin Tzvetanov Grigorov
            liam clarke Liam Clarke-Hutchinson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: