My application (Omnifaces2.0+PrimeFaces5.1+PrimeFacesExtensions3.0) gets the following ResourceHandler chain during system startup:
GraphicResourceHandler -> PrimeFacesExtensionsResourceHandler -> PrimeResourceHandler
Issue - Primefaces version number is no longer appended to PrimeFaces resources; i.e. URL's used to be:
now they are:
PrimeFacesExtensionsResourceHandler has overridden only 3 argument version of createResource(); PrimeResourceHandler has overriden ONLY 2 argument version of createResource().
JSF calls createResource with 2 arguments, your DefaultResourceHandler current implementation calls wrapped.createResource() with 3 arguments (!!!), but PrimeResourceHandler appends version number ONLY on 2 argument call.
Main issue: if JSF calls 2 argument version of createResource(), only 2 argument version must be called by all wrappers in the chain. DefaultResourceHandler breaks this (in case of Primefaces resources calls 3 argument version).
Originally, in previous OmniFaces versions, the combined, CDN and unmapped resource handler implementations had only 2-argument createResource() implemented. This caused trouble with other component libraries as reported in a.o. https://code.google.com/p/omnifaces/issues/detail?id=153
The JSF spec is unfortunately not clear in this, but technically, the PrimeFaces resource handlers are broken. They should also have implemented all 3 createResource() methods.
The problem here is indeed that the DefaultResourceHandler only looks at the available createResource() method of the directly wrapped resource handler. That directly wrapped resource handler is in turn responsible for calling the right createResource() method of its wrapped one.
In an ideal world, everyone should be overriding all 3 createResource() methods, or be using DefaultResourceHandler's approach.
In any case, technically you're right, it only unfortunately won't result in safe and DRY code. I'll brainstorm about fixing this peculiar problem from OmniFaces side on.
Fix #97: Reworked DefaultResourceHandler. It failed in case of multiple
wrapped resource handlers.
I completely reworked the DefaultResourceHandler.
It's available in today's 2.1 SNAPSHOT. Can you give it a try and let me know?
Yes, 2.1-SNAPSHOT is working correctly, PrimeFaces version number is appended again.
Thank you very much for fast fix!
DefaultResourceHandler source code is very elegant now :) and is correct regarding argument number :)
Great! Thank you for reporting.