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

HtmlResponseStateManager.getSavedState() should handle javax.faces.ViewState=""

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.2.3
    • 1.1.7, 1.2.7
    • General
    • None
    • Any

    Description

      HtmlResponseStateManager.getSavedState() does not seem to handle the request attribute "javax.faces.ViewState" being an empty string. That is to say, when the request attribute does not exist, a new state is created, but otherwise an attempt is made to reconstruct the view state. In the case that the attribute is an empty string, you'll get an exception similar to the following:

      javax.faces.FacesException: java.io.EOFException
      at org.apache.myfaces.shared_impl.util.StateUtils.getAsObject(StateUtils.java:350)
      at org.apache.myfaces.shared_impl.util.StateUtils.reconstruct(StateUtils.java:246)
      at org.apache.myfaces.renderkit.html.HtmlResponseStateManager.getSavedState(HtmlResponseStateManager.java:188)
      at org.apache.myfaces.renderkit.html.HtmlResponseStateManager.getTreeStructureToRestore(HtmlResponseStateManager.java:149)

      This does not occur on the Sun RI implementation (i.e., it returns a new state in this case), and I think due to this being an issue that should be handled (and a trivial change to boot) that it should be fixed.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            lu4242 Leonardo Uribe
            curtiss Curtiss Howard
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 5m
                5m
                Remaining:
                Remaining Estimate - 5m
                5m
                Logged:
                Time Spent - Not Specified
                Not Specified

                Slack

                  Issue deployment