jsr344-experts@javaserverfaces-spec-public.java.net

[jsr344-experts] Re: [jsr344-experts mirror] Re: Re: [971-Multi-Templating] Limitations

From: Frank Caputo <frank_at_frankcaputo.de>
Date: Fri, 24 Aug 2012 15:22:14 +0200

Hi Imre,

Am 12.08.2012 um 20:59 schrieb Imre Oßwald:

> Concerning: (From Ed Burns logged work at 22/May http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-971)
>> A multi-template is specified as a resource
>> library that includes the file template.xhtml in its top level. Every
>> Facelet VDL view in the application will be a template-client of this
>> template. PENDING: there must be some way for an application to express
>> which views should have the multi-template applied. Perhaps some kind of
>> pattern matching system?
>
> Why automatically make template.xhtml the "template-host" of every VDL-view, why not use what we already have:
> <ui:composition template="/{theme}/shoppingtemplate.xhtml">

Having the getDefaultLibraryNames solution, we don't even need {theme}, because this is handled transparently. You will always use <ui:composition template="/shoppingtemplate.xhtml">

> Doing so (with the ResourceHandler.getDefaultLibraryNames from above)
> a) We don't need pattern matching or other configuration options
> b) One can pick different base templates of the Theme/Multi-Templating for different "sections" of the site.
> c) We are - as far as I can see - done, if we change the ResourceHandling appropriately and use that for template discovery.

We are nearly. I think, the caching problem might be solved, if we always use the prefix in the cache key. This way we get two instances cached, if we fall back to no prefix, even if we only need one.

Ciao Frank