pe:ckEditor在添加CombinedResourceHandler后不再工作 [英] pe:ckEditor doesn't work anymore after adding CombinedResourceHandler

查看:335
本文介绍了pe:ckEditor在添加CombinedResourceHandler后不再工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我添加了 OmniFaces 以使用 CombinedResourceHandler
但现在是 PrimeFaces扩展 < pe:ckEditor> 不再工作。

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?

推荐答案

由于PrimeFaces扩展加载和管理JS资源的方式导致的已知问题。这已被报告为旧的Google代码主机上的问题,并在当前的 OmniFaces已知问题wiki 如下:

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扩展<= 0.7.1-4.0.0(以及可能的未来版本)



PrimeFaces扩展JS资源 primefaces-extensions.js CombinedResourceHandler 不兼容。在加载期间,它尝试从自己的< script> 元素计算版本,以便动态加载额外的CSS / JS资源。然而,这是不存在的,并且尝试失败与JS错误,这又导致额外的CSS / JS资源的动态加载例如。 CKEditor失败。

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.

您最好的选择是通过添加以下条目来排除 primefaces-extensions.js web.xml 告诉 CombinedResourceHandler 不合并PrimeFaces扩展主脚本文件:

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>

如果您使用OmniFaces 2.2或更新版本,则可以使用通配符 * as name:

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>

如果您在 3.0.0之前使用PrimeFaces扩展您还需要确保在 faces-config.xml中的 CombinedResourceHandler 后面明确声明了PrimeFaces扩展自身的资源处理程序

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>


这篇关于pe:ckEditor在添加CombinedResourceHandler后不再工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆