Since Mojarra / JSF 2.2. it is now impossible to create a custom FaceletFactory
using the web.xml
context parameter:
<context-param> <param-name>com.sun.faces.faceletFactory</param-name> <param-value>my.faces.overrides.MyFaceletFactory</param-value> </context-param>
My application provides some CMS features, including virtual host support, for serving different pages (facelets) based on the requested domain. Therefore, http://www.domain1.com/index.xhtml
returns a different content than http://www.otherdomain.com/index.xhtml
. The mechanics behind this are not so important using a dedicated resource editor. The real problem with this is that jsf caches chips only based on the requested uri that does not contain the host name ( "/index.xhtml"
in both cases). I worked on this problem by simply adding the hostname to my custom FaceletFactory
: uri = "/" + getCleanHostName() + "://" + uri;
. With JSF 2.2, this no longer seems possible. Is there any other way to archive the correct caching behavior in JSF 2.2? Disabling the face cache is not an option due to its impact on performance.
source share