JBoss.orgCommunity Documentation
This chapter covers those components used to handle and manage resources and beans.
The <a4j:keepAlive>
component allows the state of a managed bean to be retained between Ajax requests.
Managed beans can be declared with the request
scope in the faces-config.xml
configuration file, using the <managed-bean-scope>
tag. Any references to the bean instance after the request has ended will cause the server to throw an illegal argument exception (IllegalArgumentException
). The <a4j:keepAlive>
component avoids this by maintaining the state of the whole bean object for subsequent requests.
The beanName
attribute defines the request-scope managed bean name to keep alive.
The ajaxOnly
attribute determines whether or not the value of the bean should be available during non-Ajax requests; if ajaxOnly="true"
, the request-scope bean keeps its value during Ajax requests, but any non-Ajax requests will re-create the bean as a regular request-scope bean.