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

[jsr372-experts] Re: [jsr372-experts mirror] getResourcePaths like method for ResourceResolver

From: Kito Mann <kito.mann_at_virtua.com>
Date: Wed, 27 Jul 2016 07:02:18 -0400

Hello Arjan,

Can you explain the FaceViews feature in OmniFaces?

___

Kito D. Mann | @kito99 | Author, JSF in Action
Web Components, Polymer, JSF, PrimeFaces, Java EE, and Liferay training and
consulting
Virtua, Inc. | virtua.tech
JSFCentral.com | @jsfcentral | knowesis.io
<http://knowesis.io/web/webcomponents> - fresh Web Components info
+1 203-998-0403

* Listen to the Enterprise Java Newscast: *http://
<http://blogs.jsfcentral.com/JSFNewscast/>enterprisejavanews.com
<http://ww.enterprisejavanews.com>*


On Tue, Jul 26, 2016 at 6:38 PM, arjan tijms <arjan.tijms_at_gmail.com> wrote:

> Hi,
>
> The ServletContext has a method to acquire all paths to resources within a
> web application; getResourcePaths().
>
> In JSF resources are handled by the ResourceResolver. This has a method
> createViewResource that takes a path and effectively returns a URL, just
> like ServletContext has a getResource method taking a path and returning a
> URL.
>
> In both cases, the usage is to abstract the actual location of resources,
> which could therefor transparently be on a local or remote filesystem, in a
> database, custom jar location, or whatever.
>
> The JSF specific ResourceResolver however does not have a
> getResourcePaths() equivalent. I'd like to propose to rectify this by
> introducing such method for JSF view resources.
>
> Since we're targeting JDK 8 such method could take inspiration from
> Files#walk (
> https://docs.oracle.com/javase/8/docs/api/java/nio/file/Files.html#walk-java.nio.file.Path-java.nio.file.FileVisitOption...-
> )
>
> At least one use case would be for something like the FaceViews feature in
> OmniFaces, but I'd like to design this feature not just for that, of
> course. Another use case for instance would be for help in debugging
> (providing a list of all resources handled by the system could be handy to
> check for omissions or unexpected entries)
>
> Thoughts?
>
> Kind regards,
> Arjan Tijms
>