Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
djmj opened this issue Apr 8, 2015 · 4 comments
Closed

Comments

@djmj
Copy link

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 jsf URL library resource handler for resources outside of app jsf resource handler for resources outside of app with library lookup support Apr 8, 2015
@djmj
Copy link
Author

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
Copy link
Member

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
Copy link
Author

djmj commented Nov 15, 2015

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

@BalusC BalusC closed this as completed in df0d390 Dec 24, 2016
@BalusC
Copy link
Member

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants