This content has been marked as final.
Show 2 replies
-
1. Re: How to Stop Ajax4JSF framework to Stop processing throug
alexsmirnov May 15, 2007 6:08 PM (in response to jbossvarun)This-is JSF behavior. To avoid unnessesary calls to a database, You can cache value during request, for example - in a request-scope bean :
faces-config.xml :<managed-bean> <managed-bean-name>cacheBean</managed-bean-name> <managed-bean-class>foo.bar.CacheBean</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> <managed-property> <property-name>rendered</property-name> <property-class>boolean</property-class> <value>#{backing_includes_Messages.displayUserMessages}</value> </managed-property> </managed-bean>
<h:panelGrid rendered="#{cacheBean.rendered}"> </h:panelGrid>
This is a common problem for a most JSF-application developers. For a JSF 2.0 we have a proposal to store rendered, disabled and so on properties in a component, to use same value as for a rendering time. -
2. Re: How to Stop Ajax4JSF framework to Stop processing throug
jbossvarun May 15, 2007 7:04 PM (in response to jbossvarun)Thanks for the quick response. What you suggested seems to work well. I had other places where i have attached the DB lookups to other properties like:
<h:graphicImage id="graphicImageHealthCheckDatabase"
url="#{backing_pages_.healthCheckURL}" />
Can we not force the Faces Servlet to assume the the response is rendered and skip the next phase of the life cycle?
Eg:
use something like this:
FacesContext.getCurrentInstance().renderResponse()