jsf resource handler for resources outside of app with library lookup support #122

djmj opened this Issue Apr 8, 2015 · 4 comments


None yet

2 participants

djmj commented Apr 8, 2015

A resource handler that allows resource not to be within webapp like the CDNResourceHandler behaved prior to 2.0 release.

There are several advantages:

  • Migration from CDN to local resources or back is just a matter of moving resources (No code must be updated)
  • JSF library mechanism for h:outputScript and other tags serves as single interface to obtain resources, regardless of their location
  • Using library syntax the base url can be hidden since its defined in web.xml (more separation)
  • Versioned resources can be declared without need of version number since web.xml decides which version to take.

This resource handler could have precedence over CDNResourceHandler or just be used in case no local resource was found.

@djmj djmj changed the title from jsf URL library resource handler for resources outside of app to jsf resource handler for resources outside of app with library lookup support Apr 8, 2015
djmj commented Nov 3, 2015

Any love for this issue? Else i will extract CDNResourceHandler from version 1.8.1 and rename it before I update omnifaces to a current release.

BalusC commented Nov 5, 2015

I looked at it several times during #27. Can't find a satisfiable solution without breaking resource handling/ordering and architectural design principles. Will look again for OmniFaces 2.3.

I have at least clarified the javadoc to prevent the CDNResourceHandler unnecessarily being abused for non-existing resources. See http://omnifaces.org/docs/javadoc/current/org/omnifaces/resourcehandler/CDNResourceHandler.html

This ResourceHandler implementation allows the developer to provide external (CDN) URLs instead of the default local URLs for JSF resources. This also works on auto-included resources provided as @ResourceDependency by the JSF implementation and/or component libraries. For example, JSF's own javax.faces:jsf.js resource or PrimeFaces' primefaces:jquery/jquery.js resource could be pointed to a CDN.

For non-JSF resources, you can just keep using plain HTML <script> and <link> elements referring the external URL.

djmj commented Nov 15, 2015

Thanks to let me know and for your work :) omnifaces rocks!

@BalusC BalusC added a commit that closed this issue Dec 24, 2016
@BalusC BalusC Fix #122 Drop local resource requirement of CDNResourceHandler so it
works regardless of whether the resource is included in webapp
@BalusC BalusC closed this in df0d390 Dec 24, 2016
BalusC commented Dec 24, 2016

As more and more people are asking for this, and I couldn't nicely implement #27, I've enhanced the CDNResourceHandler instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment