pe:ckEditor doesn't work anymore after adding CombinedResourceHandler

我与影子孤独终老i 提交于 2019-12-20 02:11:22

问题


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 with CombinedResourceHandler. 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 to web.xml telling the CombinedResourceHandler 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 in faces-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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!