HTML and CSS Reference
In-Depth Information
<param-value>false</param-value>
</context-param>
...
</web-app>
Stateless JSF
One of the useful features of JSF 2.2 is the ability to create stateless views. Creating stateless views has two main advantages:
Stateless view has a better performance than the default stateful view, because no time is
spent for saving and restoring the state of the dynamic components inside <h:form> .
<h:form> ), because
no memory is consumed for saving the state of the dynamic components inside <h:form> .
Stateless view consumes less memory than the default stateful view (with
Although both the performance and memory gains can be relatively small for small and medium pages, this gain
can be significant when you have large pages with many components in your application and also when your JSF
application has a lot of concurrent users with limited hardware capabilities; this means that stateless views can serve
for making JSF applications more scalable.
Note
Stateless views is one of the most powerful options if you are seeking to develop public web sites using JSF.
Because stateless views do not have state, it is important to realize that they will not work with both view and
session scoped beans; this means that you should be aware that your managed beans are set in request scope.
Stateless view may not be compatible with JSF component libraries such as primeFaces or richFaces.
So, generally, you have to verify whether the JSF component you are using is working well in stateless mode.
Note
In order to apply stateless behavior to your JSF view, you need to set transient attribute of <f:view> to true as
shown in the following.
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html>
<f:view xmlns=" http://www.w3.org/1999/xhtml "
xmlns:f=" http://xmlns.jcp.org/jsf/core "
xmlns:h=" http://xmlns.jcp.org/jsf/html "
transient="true" >
<html>
<h:head>
<title>Stateless Page</title>
</h:head>
<h:body>
<!-- JSF HTML components -->
</h:body>
</html>
</f:view>
This is all what you need to do in order to make your JSF view stateless.
 
 
Search WWH ::




Custom Search