For example the request to fetch framework.pack.js with the ALL LoadStrategy, I was getting something like:
However when changing to NONE strategy and overriding the doHeaders method for my portlets, I started seeing requests like:
which was being cached correctly, and taking the default org.ajax4jsf.DEFAULT_EXPIRE value of 86400 (24 hours).
If anyone has had any luck caching RichFaces with the ALL LoadStrategy please let me know. I'm using the following technologies:
My issue was not that it didn't work, but I noticed that it was bringing the entire payload of RichFaces over on every request, which if I recall correctly (it's been awhile) was about 1MB. I'm not sure if it was a configuration issue on my end, but that's what I noticed. Instead we went with just having an abstract richfaces portlet which performed the doHeaders "stuff". This was a better solution in the end for us anyways.
OK, what i did:
1) own implementation of GenericFacesPortlet
2) using this implementation in portlet.xml
3) in portlet.xml, additionally configured:
<container-runtime-option> <name>javax.portlet.renderHeaders</name> <value>true</value> </container-runtime-option>
<context-param> <param-name>org.richfaces.LoadStyleStrategy</param-name> <param-value>NONE</param-value> </context-param> <context-param> <param-name>org.richfaces.LoadScriptStrategy</param-name> <param-value>NONE</param-value> </context-param> <context-param> <param-name>org.ajax4jsf.RESOURCE_URI_PREFIX</param-name> <param-value>rfRes</param-value> </context-param> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>/faces/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.seam</url-pattern> </servlet-mapping>
5) I got 404 error_ can't find http://localhost:8080/my-application/faces/rfRes/org/ajax4jsf/framework.pack.js
I am not able to invoke this resource manually.
I did follow guidelines defined here http://docs.redhat.com/docs/en-US/JBoss_Enterprise_Portal_Platform/5.0/html/Reference_Guide/sect-Reference_Guide-Bridge_Configuration-RichFaces_Setup_and_Configuration_Options.html and here http://community.jboss.org/wiki/jQueryportlet.
Anybody an idea what's wrong?
Thanks a lot
thanks a lot for your reply.
Do you have the ajax4jsf filter defined in your web.xml ?
Regarding to documentation, this is not required: http://docs.redhat.com/docs/en-US/JBoss_Enterprise_Portal_Platform/5.0/html/Reference_Guide/sect-Reference_Guide-Bridge_Configuration-RichFaces_Setup_and_Configuration_Options.html
I did try this anyway - and you're right (-:
In web.xml, Ajax4jsf-Filter needs to be configured - and not SeamResourceServlet and SeamFilter.
Caching works as expected now.
it was bringing the entire payload of RichFaces over on every request, which if I recall correctly (it's been awhile) was about 1MB
I am bumping in the same problem.
no cache of the RichFaces scripts and CSS...
Thank's a lot for the answers and explainations.
JBoss Portal and GateIn, JSF, Richfaces, J2EE.