RichFaces 4替换< a4j:loadScript> [英] RichFaces 4 replacement for <a4j:loadScript>
问题描述
我目前正在使用RichFaces 3.3将旧版JSF 1.2应用程序迁移到JSF 2.0和RichFaces 4.
I'm currently migrating a legacy JSF 1.2 application using RichFaces 3.3 to JSF 2.0 and RichFaces 4.
但是,包含与RichFaces捆绑在一起的jQuery库不会通过包含< a4j:loadScript src =resource://jquery.js/>
,作为< a4j:loadScript> ;
组件已从RichFaces版本4中删除。
However, inclusion of the jQuery library bundled with RichFaces does no longer work by including <a4j:loadScript src="resource://jquery.js"/>
, as the <a4j:loadScript>
component has been removed from RichFaces version 4.
RF 3.3到4迁移指南没有说明如何包含捆绑的脚本。
我见过使用< h:outputScript name =jquery.jstarget =head/>
的建议,但这不会产生任何输出在渲染页面中的任何内容。
The RF 3.3 to 4 migration guide does not state how to include the bundled scripts otherwise.
I've seen suggestions to use <h:outputScript name="jquery.js" target="head" />
, but this produces no output whatever in the rendered page.
有没有人有解决方案来加载这些捆绑的脚本?提前致谢!
Has anyone got a solution to load those bundled scripts? Thanks in advance!
推荐答案
获取< h:outputScript target =head>
要工作,您需要< h:head>
而不是< head>
在主模板中。
To get <h:outputScript target="head">
to work, you need to have a <h:head>
instead of a <head>
in the master template.
无关到具体问题,RichFaces 4已经附带捆绑的jQuery。您不一定需要自己加载一个。
Unrelated to the concrete problem, RichFaces 4 already ships with bundled jQuery. You do not necessarily need to load one yourself.
这篇关于RichFaces 4替换< a4j:loadScript>的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!