RichFaces 4 replacement for <a4j:loadScript>

a 夏天 提交于 2019-12-10 16:21:25

问题


I'm currently migrating a legacy JSF 1.2 application using RichFaces 3.3 to JSF 2.0 and 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.

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!


回答1:


To get <h:outputScript target="head"> to work, you need to have a <h:head> instead of a <head> in the master template.


Unrelated to the concrete problem, RichFaces 4 already ships with bundled jQuery. You do not necessarily need to load one yourself.



来源:https://stackoverflow.com/questions/8154232/richfaces-4-replacement-for-a4jloadscript

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