We're using PrimeFaces in our business app and so far everything is fine. However, as this application goes live we are proxying requests from a different server down to the application server itself. Due to this, all of our link URLs need to be prefixed with a "base url" that is passed to us in the header from the proxy server. This works fine for all URLs that we have control over, however, the resources URLs are not modifiable as they are written by PrimeFaces.
I was looking at the source and in ResourcesUtils there is the following lines of code that create the URLs that PrimeFaces write:
Code: Select all
String contextPath = facesContext.getExternalContext().getRequestContextPath();
return contextPath + RESOURCE_PATTERN + VERSION_INFO + resource;
Would it be possible for the <resources> tag to take a prefix option (ideally populated via EL) so that we can prefix all the Resource URLs with the necessary base url? Something like:
Code: Select all
<p:resources prefix="#{bean.baseUrl}" />
Code: Select all
return prefix + contextPath + RESOURCE_PATTERN + VERSION_INFO + resource;
Regards,
Emil