MyFaces Portlet Bridge
  1. MyFaces Portlet Bridge

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


    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0-alpha, 1.0.0-alpha-2, 1.0.0-beta, 2.0.0-alpha
    • Fix Version/s: 1.0.0-alpha-3
    • Component/s: Impl
    • Labels:


      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.

      1. jira_33.patch
        0.7 kB
        Michael Freedman



          • Assignee:
            Michael Freedman
            Michael Freedman
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: