Struts 1
  1. Struts 1
  2. STR-2295

FacesRequestProcessor call to lifecycle.render(context) needs to be wrapped in a try, finally

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.4
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: PC

      Description

      In FacesRequestProcessor.doForward() (as well as FacesTilesRequestProcessor), if
      the call to lifecycle.render(context) throws an exception, then the context is
      never given a chance to be released, resulting in an invalid FacesContext being
      pegged to the executing thread.

      The following code:
      ======== SNIP ========
      lifecycle.render(context);
      if (created) {
      if (log.isTraceEnabled())

      { log.trace(" Releasing context for '" + uri + "'"); }

      context.release();
      } else {
      if (log.isTraceEnabled())

      { log.trace(" Rendering completed"); }

      }
      ======== /SNIP ========

      Should probably be changed to something like:
      ======== SNIP ========
      try

      { lifecycle.render(context); }

      finally {
      if (created) {
      if (log.isTraceEnabled())

      { log.trace(" Releasing context for '" + uri + "'"); }

      context.release();
      } else {
      if (log.isTraceEnabled())

      { log.trace(" Rendering completed"); }

      }
      }
      ======== /SNIP ========

        Activity

        Hide
        Craig McClanahan added a comment -

        Fixed in nightly build 20041231. Thanks for the patch!

        Show
        Craig McClanahan added a comment - Fixed in nightly build 20041231. Thanks for the patch!

          People

          • Assignee:
            Unassigned
            Reporter:
            Chris Fraser
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development