Uploaded image for project: 'MyFaces Portlet Bridge'
  1. MyFaces Portlet Bridge
  2. PORTLETBRIDGE-33

Redirect during action causes infinite loop if action/render run in same request

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.0.0-alpha, 1.0.0-alpha-2, 1.0.0-beta, 2.0.0-alpha
    • 1.0.0-alpha-3
    • Impl
    • None

    Description

      Redirect (of a Faces view) during an action is caught by the bridge and turned into a simple navigation – I.e. we view such a redirect as meaning change the view of the this portlet NOT change the view of the browser from the consumer page. Its impelmented by tacking a request attribute on in the redirect method and then detecting this attr in the lifecycle manager/controller (doFacesRequest). If a redirect is detected we return normally but don't preserve state. However the code doesn't remove the redirect request attribute. If the portlet container turns around and calls render in the same request scope the attr still exists. And as we upgraded the render impl to also detect/support such redirects, the carrying forward of this attribute causes the render to also think it now needs to do one of these navigational redirects – and the by product of executing this causes us to rerun the render with the same request attributes as the render started with – but oops this already contained the redirect attr carried forward from the action – so we get into an infinite loop.

      Solution is simple: merely remove the request attr before returning from the action.

      Attachments

        1. jira_33.patch
          0.7 kB
          Michael Freedman

        Activity

          People

            mike_freedman Michael Freedman
            mike_freedman Michael Freedman
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: