[
https://issues.apache.org/jira/browse/WICKET-2102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Pavel Cernocky reopened WICKET-2102:
------------------------------------
It was not so easy as I expected.
Cache key should contain locale, which is taken from Component, so when no
Component is given cache will be populated with string from first requested
locale and will return it also for all other locales.
> Localizer never caches resources when component is not given
> ------------------------------------------------------------
>
> Key: WICKET-2102
> URL: https://issues.apache.org/jira/browse/WICKET-2102
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.3.5
> Reporter: Pavel Cernocky
> Assignee: Juergen Donnerstag
> Fix For: 1.4-RC3
>
> Attachments: diff.patch
>
>
> In org.apache.wicket.Localizer.getString(String, Component, IModel, String)
> there's this code:
> // If this component is not yet added to page we do not want to check
> // cache as we can generate an invalid cache key
> if ((cache != null) && addedToPage)
> {
> cacheKey = getCacheKey(key, component);
> }
> If the component is null, then addedToPage is always false, thus cacheKey is
> never populated and possibly found resource is never put in cache.
> The condition should be:
> if ((cache != null) && (component == null || addedToPage))
> Cheers,
> Palo
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.