Tiles
  1. Tiles
  2. TILES-365

Test webapp "testimportattribute_inherit.jsp" test fails

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.2
    • Fix Version/s: 2.1.3
    • Component/s: tiles-core
    • Labels:
      None

      Description

      The "testimportattribute_inherit.jsp" fails, because it displays:

      • valueOne
      • valueTwo
      • valueThree
      • valueOne
      • valueTwo
      • valueThree
      • valueOne
      • valueTwo
      • valueThree
      • valueFour

      Instead of:

      • valueOne
      • valueTwo
      • valueThree
      • valueFour

        Issue Links

          Activity

          Hide
          Lukasz Racon added a comment -

          Antonio,
          while fixing this one I think that you have reintroduced TILES-340 - parent definitions do not have inheritance and wildcards resolved.

          Revision 743737 changed this line:
          protected Map<String, Definition> loadParentDefinitions(Locale parentLocale)

          { - return loadRawDefinitionsFromURLs(parentLocale); + return loadDefinitionsFromURLs(parentLocale); }

          After deploying the application if the first user's locale is set to 'en_US' the ResolvingLocaleUrlDefinitionDAO loads 'null' then 'en' definitions, then it loads 'en_US' definitions.

          ResolvingLocaleUrlDefinitionDAO.postDefinitionLoadOperations is called only for the 'en_US' definitions, while parent ('null' and 'en') locale definitions are never resolved (inheritance and wildcards). If next user has 'en' locale s/he gets NoSuchDefinitionException.

          Show
          Lukasz Racon added a comment - Antonio, while fixing this one I think that you have reintroduced TILES-340 - parent definitions do not have inheritance and wildcards resolved. Revision 743737 changed this line: protected Map<String, Definition> loadParentDefinitions(Locale parentLocale) { - return loadRawDefinitionsFromURLs(parentLocale); + return loadDefinitionsFromURLs(parentLocale); } After deploying the application if the first user's locale is set to 'en_US' the ResolvingLocaleUrlDefinitionDAO loads 'null' then 'en' definitions, then it loads 'en_US' definitions. ResolvingLocaleUrlDefinitionDAO.postDefinitionLoadOperations is called only for the 'en_US' definitions, while parent ('null' and 'en') locale definitions are never resolved (inheritance and wildcards). If next user has 'en' locale s/he gets NoSuchDefinitionException.
          Hide
          Antonio Petrelli added a comment -

          Now the list attributes are inherited only once.

          Show
          Antonio Petrelli added a comment - Now the list attributes are inherited only once.
          Hide
          Antonio Petrelli added a comment -

          The problem is in CachingLocaleUrlDefinitionDAO and ResolvingLocaleUrlDefinitionDAO.
          In particular, in the latter one, the definitions are loaded and immediately resolved (speaking of definition inheritance).
          In case of multiple locale, the URLs are loaded (grouped by locale) and then resolved starting from the "null" locale to the chosen locale.
          For example, if I have "it_IT" locale:

          • definitions of "null" locale are loaded, then resolved;
          • definitions of "it" locale are loaded, then resolved;
          • definitions of "it_IT" locale are loaded, then resolved.
            These definitions MUST be resolved only at the end, not 3 times.
          Show
          Antonio Petrelli added a comment - The problem is in CachingLocaleUrlDefinitionDAO and ResolvingLocaleUrlDefinitionDAO. In particular, in the latter one, the definitions are loaded and immediately resolved (speaking of definition inheritance). In case of multiple locale, the URLs are loaded (grouped by locale) and then resolved starting from the "null" locale to the chosen locale. For example, if I have "it_IT" locale: definitions of "null" locale are loaded, then resolved; definitions of "it" locale are loaded, then resolved; definitions of "it_IT" locale are loaded, then resolved. These definitions MUST be resolved only at the end, not 3 times.

            People

            • Assignee:
              Antonio Petrelli
              Reporter:
              Antonio Petrelli
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development