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

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

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

Hi Leonardo,

Am 13.08.2012 um 03:52 schrieb Leonardo Uribe:

>> I think tying it to the library name is a good idea. Maybe we can have something like ResourceHandler.getDefaultLibraryName(FacesContext), which is simply a prefix for all resources requested in the given FacesContext. E.g:
>>
>> ResourceHandler.getDefaultLibraryName(FacesContext) returns "mobile"
>> ResourceHandler.createResource("main.css", "css") becomes ResourceHandler.createResource("main.css", "mobile/css")
>> If ResourceHandler.createResource("main.css", "mobile/css") returns null, use ResourceHandler.createResource("main.css", "css")
>>
>
> It is an option, but it has its advantages:
>
> - It is only required to extend the concept of libraryName.
> - No need to update request url spec.
>
> and disadvantages.
>
> - If skinning/templating is built on top of libraryName, no changes in
> request url are required, but all limitations of libraryName applies,
> like do not allow '/' in libraryName, so the example proposed
> replacing libraryName with "mobile/css" is invalid according to
> current spec. See: https://issues.apache.org/jira/browse/MYFACES-3454
> for details.

Library and resource name result in a resource identifier. So if we call the new method ResourceHandler.getResourcePrefix(FacesContext), we can simply prefix all resource identifiers and have it.

Ciao Frank