问题
I added OmniFaces to use the CombinedResourceHandler. But now the PrimeFaces Extensions <pe:ckEditor> doesn´t work anymore.
Is there any workaround for this issue?
回答1:
Unfortunately, this is a known issue caused by the way how PrimeFaces Extensions loads and manages its JS resources. This was already ever reported as an issue on old Google Code host and is mentioned in the current OmniFaces known issues wiki as follows:
PrimeFaces Extensions <=0.7.1-4.0.0 (and probably future versions)
PrimeFaces Extensions JS resource
primefaces-extensions.js
is incompatible withCombinedResourceHandler
. During load, it attempts to figure the version from its own<script>
element in order to dynamically load additional CSS/JS resources. This is however absent and the attempt fails with a JS error which in turn causes the dynamic loading of additional CSS/JS resources for e.g. CKEditor to fail.Your best bet is to exclude
primefaces-extensions.js
from combining by adding the following entry toweb.xml
telling theCombinedResourceHandler
to not combine the PrimeFaces Extensions main script file:<context-param> <param-name>org.omnifaces.COMBINED_RESOURCE_HANDLER_EXCLUDED_RESOURCES</param-name> <param-value>primefaces-extensions:primefaces-extensions.js</param-value> </context-param>
If you're using OmniFaces 2.2 or newer, then you can use a wildcard
*
as name:<context-param> <param-name>org.omnifaces.COMBINED_RESOURCE_HANDLER_EXCLUDED_RESOURCES</param-name> <param-value>primefaces-extensions:*</param-value> </context-param>
If you're using PrimeFaces Extensions before version 3.0.0, then you also need to make sure that the PrimeFaces Extensions own resource handler is explicitly declared after
CombinedResourceHandler
infaces-config.xml
:<application> <resource-handler>org.omnifaces.resourcehandler.CombinedResourceHandler</resource-handler> <resource-handler>org.primefaces.extensions.application.PrimeFacesExtensionsResourceHandler</resource-handler> </application>
回答2:
This issue is fixed in PrimeFaces Extensions 6.2.8 or higher.
https://github.com/primefaces-extensions/primefaces-extensions.github.com/issues/601
来源:https://stackoverflow.com/questions/25003338/peckeditor-doesnt-work-anymore-after-adding-combinedresourcehandler