4

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 Answer 1

2

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.

1
  • Thanks for the hint, you pushed me in the right direction. The underlying problem was caused by PrettyFaces messing with the resource URLs for some reason, though. :)
    – AdrianoKF
    Nov 18, 2011 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.