Uploaded image for project: 'MyFaces Tomahawk'
  1. MyFaces Tomahawk
  2. TOMAHAWK-902

Bug in DefaultAddResource. Resources added AddResource.BODY_END are rendered in the page header

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • 1.1.3
    • None
    • ExtensionsFilter
    • None

    Description

      Resources added with a position of AddResource.BODY_END are rendered in the page header not at body end.

      In DefaultAddResource.writeWithFullHeader:724:
      if (afterBodyContentInsertPosition >= 0)

      { ... originalResponse.insert(headerInsertPosition, writerWrapper.toString()); }

      Shouldn't this be:
      if (afterBodyContentInsertPosition >= 0)

      { ... originalResponse.insert(afterBodyContentInsertPosition, writerWrapper.toString()); }

      Workaround:
      Write your own AddResource implementation (just copy the DefaultAddResource); include this fix; override default in web.xml with:
      <context-param>
      <param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name>
      <param-value>au.com.project.common.ui.renderkit.html.util.DefaultAddResource</param-value>
      <description>Override default resource handler (extensions filter)</description>
      </context-param>

      Attachments

        1. one-line-fix.diff
          0.6 kB
          Paul Pogonyshev

        Activity

          People

            Unassigned Unassigned
            computabloke David Turner
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: