HI Hebert, we have the same issue. Richfaces don't provide any option to configure a centralized web context to supply these resources files, so I have made a patch for Richfaces. I was about to post about this patch here in the forums to discuss this change with the community.
You will have the change the org.ajax4jsf.webapp.WebXml class the method:
"public String getFacesResourceURL(FacesContext context, String Url, boolean isGlobal)"
This method returns a "resourceURL" all you have to do is add this kind if code:
resourceURL = MY_CENTRALIZED_CONTEXT + resourceURL.substring(resourceURL.indexOf(RESOURCE_URI_PREFIX));
where MY_CENTRALIZED_CONTEXT is a constant with a value like that: "/myContext/"
You can initialize this constant with a context param, like the others that a4j use, or just code it.
So, what do you think about we open a JIRA issue requesting this improvement to Richfaces?
Ps.: I have patched Richfaces 3.3.1 (this is the release we are using)
The class org.ajax4jsf.webapp.WebXml is placed on richfaces-impl file.
yes, great. i also already had a look at this class and was considering changing it :-)
i just thought that there must be a better solution
so thanks for your hint, i agree that we should add this as a feature request for RichFaces!
will try it out in the next couple of days / weeks depending on our workload
There is another issue that may affect you, the Richfaces don't set the "public" value on Cache-control header tag, so if you are running your applications under https, none of theses resources will be cached on disk.
For more details, I am discussing this on this thread: