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

Non-default Tiles extension is not applied on the first request

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • Tiles
    • None

    Description

      The changes made for MYFACES-150 allow a different extension to be used for Tiles definitions (the default is .tiles). However, there is a bug in the implementation of this. The definitions factory is lazily loaded by getDefinitionsFactory(), and a non-default extension will be set at this time. The first time renderView() is called, though, it calculates the tilesId before getDefinitionsFactory() gets called, and will therefore use the default extension. On subsequent calls, the correct extension will be used. To fix this, a call needs to be made to getDefinitionsFactory() before the tilesId is calculated, e.g.:

      DefinitionsFactory factory = getDefinitionsFactory();
      String tilesId = viewId;
      int idx = tilesId.lastIndexOf('.');
      if (idx > 0)

      { tilesId = tilesId.substring(0, idx) + tilesExtension; }

      else

      { tilesId = tilesId + tilesExtension; }

      ...
      definition = factory.getDefinition(tilesId, request, servletContext);

      Attachments

        Activity

          People

            Unassigned Unassigned
            ctgorilla Colin Sharples
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: