Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-2295

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2.4
    • None
    • None
    • Operating System: All
      Platform: PC
    • 32370

    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 ========

      Attachments

        Activity

          People

            Unassigned Unassigned
            cfraser@ticketweb.com Chris Fraser
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: