简体   繁体   English

RichFaces 4的替代品<a4j:loadScript>

[英]RichFaces 4 replacement for <a4j:loadScript>

I'm currently migrating a legacy JSF 1.2 application using RichFaces 3.3 to JSF 2.0 and RichFaces 4. 我目前正在将使用RichFaces 3.3的旧版JSF 1.2应用程序迁移到JSF 2.0和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. 但是,通过包含<a4j:loadScript src="resource://jquery.js"/>不再包含与RichFaces捆绑在一起的jQuery库,因为<a4j:loadScript>组件已从RichFaces版本4中删除。

The RF 3.3 to 4 migration guide does not state how to include the bundled scripts otherwise. RF 3.3到4的迁移指南没有说明如何以其他方式包含捆绑的脚本。 I've seen suggestions to use <h:outputScript name="jquery.js" target="head" /> , but this produces no output whatever in the rendered page. 我已经看到使用<h:outputScript name="jquery.js" target="head" /> ,但这在呈现的页面中不会产生任何输出。

Has anyone got a solution to load those bundled scripts? 有没有人找到加载这些捆绑脚本的解决方案? Thanks in advance! 提前致谢!

To get <h:outputScript target="head"> to work, you need to have a <h:head> instead of a <head> in the master template. 为了使<h:outputScript target="head">起作用,您需要在主模板中使用<h:head>而不是<head>


Unrelated to the concrete problem, RichFaces 4 already ships with bundled jQuery. 具体问题无关 ,RichFaces 4已经附带了捆绑的jQuery。 You do not necessarily need to load one yourself. 您不一定需要自己加载。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM