问题
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