[
https://issues.apache.org/jira/browse/TILES-573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13810967#comment-13810967
]
Eric B commented on TILES-573:
------------------------------
In
org.apache.tiles.definition.pattern.AbstractPatternDefinitionResolver<T>.storeDefinitionPatterns()
(line 61), localePatternPaths is never reset whenever the locale2definitionMap
is cleared in
org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.checkAndloadDefinitions()
(lin 172).
Consequently, everytime tiles re-reads the tiles.xml file, it just appends any
Pattern definitions to the localePatternPaths list in
AbstractPatternDefinitionResolver.addDefinitionsAsPatternMatchers.
This ends up with a couple of issues.
1) when Tiles tries to retrieve the matching pattern, it simply loops through
the localePatternPaths ArrayList and returns the first match it finds. So even
if the newer definition was loaded, Tiles still returns the original pattern.
2) this can lead to a memory leak, since the list is never actually cleared,
but constantly adds new entries. Although this is unlikely to happen, it is
still a risk.
I'm not sure, however, how to clear the entry in locatePatternPaths, as it is a
private variable in AbstractPatternDefinitionResolver, with no public methods
accessible. The best I could think of would be to create a method in
AbstractPatternDefinitionResolver called clearDefinitions(customizationKey) or
something to that effect, and call it from within
CachingLocateUrlDefinitionDAO.checkAndloadDefinitions() when
locale2definitionMap is cleared.
> Tiles.xml definitions not reloaded when using expressions
> ---------------------------------------------------------
>
> Key: TILES-573
> URL: https://issues.apache.org/jira/browse/TILES-573
> Project: Tiles
> Issue Type: Bug
> Components: tiles-core, tiles-template
> Affects Versions: 3.0.1
> Reporter: Eric B
> Attachments: tiles.xml
>
>
> When tiles.xml contains definitions that use expressions (ex: "REGEXP:
> (.*)"), the definitions are not reloaded when tiles.xml is changed, even if
> checkRefresh is enabled.
> tiles.xml definitions are properly reloaded when they contain plain strings,
> but otherwise they are ignored.
>
--
This message was sent by Atlassian JIRA
(v6.1#6144)