Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-3835

ViewState gets truncated on chrome with richfaces fileupload component

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.11, 2.1.13
    • 2.0.20, 2.1.14, 2.2.0
    • None
    • None
    • Windows XP, Chrome 31.0.1650.63 m (latest at this moment), tomcat 7.0.37, client state saving, myfaces 2.1.11, richfaces 4.3.1.Final

    Description

      On certain conditions viewstate gets corrupted (truncated).

      I've got a page with a richfaces fileupload component. The page works well on IE7 and Firefox (latest), but not in chrome. Digging into Javascript and Ajax response I got some extra info about the problem. I don't know why, but a partial response like:

      <?xml version="1.0" encoding="utf-8"?><partial-response><changes><update id="javax.faces.ViewState"><![CDATA[....

      results in two CDATA sections when handling the response. This is the problem caused by Google Chrome. Inspecting the JSF.JS library, the line that gets de updated view state is:

      mfInternal.appliedViewState = node.firstChild.nodeValue;

      This line is in 'processUpdate' method. When Chrome, for some reason splits the original CDATA block into two, that line only updates the first section, obtaining a truncated viewState and ViewExpiredException in next request.

      The first CDATA section created by Google Chrome has 300 bytes. Weird, but searching Google for 'Chrome cdata 300' appears to be a libxml2 problem.

      Attachments

        1. web.xml
          8 kB
          Ricardo Tercero Lozano
        2. imgUpload-sample.xhtml
          3 kB
          Ricardo Tercero Lozano
        3. FileUploadBean.java
          3 kB
          Ricardo Tercero Lozano
        4. FileUploadBean.class
          4 kB
          Ricardo Tercero Lozano

        Activity

          People

            Unassigned Unassigned
            moevr Ricardo Tercero Lozano
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: