Bad caching in <wicket:message> tag for the same key in same markup structure
-----------------------------------------------------------------------------

                 Key: WICKET-1697
                 URL: https://issues.apache.org/jira/browse/WICKET-1697
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.4-M2
         Environment: Wicket 1.4-M2, Java 1.6, Windows
            Reporter: Karel Cabel
            Priority: Minor


wicket:message tag constructs the same key string (into cache) for same text 
key in the same 'element structure' in different pages. So if you load string 
in one page, this string will not change in other page until you change 
language etc.
Example: you have two independent pages (in different packages) with own 
*.properties files (with 'title' key) and each page has HTML markup:
<wicket:extend> <wicket:message key="title"> ....

In this case, Localizer.java in line 210 will produce the same key (for 
'title') for two independent pages. Because there is no parent div in markup 
file, cache key will be like this:
"title-org.apache.wicket.markup.resolver.MarkupInheritanceResolver$TransparentWebMarkupContainer:_extend11-org.apache.wicket.markup.resolver.MarkupInheritanceResolver$TransparentWebMarkupContainer:_child10-cs-null"
but same for BOTH pages.
Problem is, that this cache key is constructed via parent tags in HTML (up to 
page) and if you have the same parents and same key attribute in message tag, 
it will always hit cached string from other pages.

The only way to avoid this is to use different message keys in different pages. 
But this is very bad for us.
I think, that one good solution is to append page name into cache string - it 
will be like namespace in XML...

Bye (perfect work with Wicket!)
Karel, Prague

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to