Search code examples
javascriptjsfrichfaces

JavaScript files are not reaching my browser when using Richfaces tree


I've narrowed the problem down in this post

Richfaces tree is giving me an "Uncaught ReferenceError tree is not defined"

to not having any JavaScript files reach the web browser. Does anyone know why RichFaces JavaScript files aren't getting to/being sent to the browser?

I have an isolated tree project that works and there are a lot of JS files getting to the browser.

I'm using JSF 1.2 so the suggested h:head fix won't work in my case.


Solution

  • So I figured out what the problem was. For some reason Richfaces was not sending the script or styling files to the browser. It dynamically puts the links in the head. So I add the following filters to the web.xml file and everything is happy now including me and my partner.

    <context-param>
        <param-name>org.richfaces.LoadStyleStrategy</param-name>
        <param-value>ALL</param-value>
    </context-param> 
    <context-param>
        <param-name>org.richfaces.LoadScriptStrategy</param-name>
        <param-value>ALL</param-value>
    </context-param>
    

    Hopefully this helps someone else.