tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mohamed Rabie Hayoun Ben Maimoun <mrhay...@gmail.com>
Subject Re: split tiles config files
Date Tue, 13 Sep 2011 10:24:02 GMT
Thanks!!!!
El 12/09/2011 12:55, "Mck" <mck@apache.org> escribió:
> On Tue, 2011-09-06 at 21:21 +0200, Antonio Petrelli wrote:
>> 2. Create your own initializer and TilesContainerFactory, extending
>> BasicTilesContainerFactory.getSourceURLs.
>
> This is the way i did it.
> With the following code in your container factory:
>
> @Override
> protected List<URL> getSourceURLs(
> final ApplicationContext applicationContext) {
>
> try {
> final Set<URL> finalSet = new HashSet<URL>();
> final Set<URL> webINFSet =
applicationContext.getResources("/WEB-INF/**/tiles*.xml");
> final Set<URL> metaINFSet =
applicationContext.getResources("classpath*:META-INF/**/tiles*.xml");
>
> if (webINFSet != null) {
> finalSet.addAll(webINFSet);
> }
> if (metaINFSet != null) {
> finalSet.addAll(metaINFSet);
> }
>
> return URLUtil.getBaseTilesDefinitionURLs(finalSet);
> } catch (IOException e) {
> throw new DefinitionsFactoryException("Cannot load definition URLs", e);
> }
> }
>
>
> we load all tiles*.xml from WEB-INF and META-INF locations.
>
> ~mck

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message