Replacing RichFaces 4 for <a4j: loadScript>

I am currently porting an outdated JSF 1.2 application using RichFaces 3.3 in JSF 2.0 and RichFaces 4.

However, including the jQuery library bundled with RichFaces no longer works, including <a4j:loadScript src="resource://jquery.js"/> , because the <a4j:loadScript> component has been removed from RichFaces version 4.

The migration guide from 3.3 to 4 does not indicate how to include nested scripts otherwise. I saw suggestions to use <h:outputScript name="jquery.js" target="head" /> , but this does not produce any output on the displayed page.

Anyone have a solution to download these related scripts? Thanks in advance!

+4
source share
1 answer

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


Unrelated to a specific problem, RichFaces 4 already comes with a jQuery suite. You do not have to download them yourself.

+2
source

Source: https://habr.com/ru/post/1381514/


All Articles