HTML and CSS Reference
In-Depth Information
It is important to understand the semantics of both parameters:
numberOfLogicalViews parameter refers to the number of logical views in the session which
you can experiment by opening your JSF application in different browser tabs; every browser tab
represents a logical view ( GET view). For example, if the numberOfLogicalViews parameter is set
to three and you open four different browser tabs in sequence, go to the first tab, and submit the
form (assuming that the page contains form), then you will get ViewExpiredException because
the first tab which represents the first logical view is removed from the LRU (Least Recently
Used) map of the logical views. This also means that if you open three different browser tabs
in sequence and you go to any of the tabs to submit the form, you will not face this exception
because you did not exceed the maximum number of logical views, which is three.
numberOfViewsInSession parameter refers to the number of POST views in the session,
which you can experiment by submitting a form in a page many times. For example if
numberOfViewsInSession parameter is set to three, and you submit a page form four times,
press the browser back button four times, and then resubmit the first page form, you will get
ViewExpiredException because the first page form which represents the first view is removed
from the LRU map of the POST views. This also means that if you submit the form three times
and you go back to resubmit the first page form, you will not face this exception because you
did not exceed the maximum number of POST views, which is three.
Apache MyFaces Specific Tuning
If you have enough memory in the application server and because compression consumes CPU time, you can disable
server state compression as follows.
<?xml version="1.0" encoding="UTF-8"?>
<web-app ...>
...
<context-param>
<param-name>
org.apache.myfaces.COMPRESS_STATE_IN_SESSION
</param-name>
<param-value>false</param-value>
</context-param>
...
</web-app>
Note that the ( org.apache.myfaces.COMPRESS_STATE_IN_SESSION ) parameter works when the state
saving method is set to "server" . Another important parameter that you need to take care about when the
state saving method is set to "server" is ( org.apache.myfaces.SERIALIZE_STATE_IN_SESSION ). Setting
org.apache.myfaces.SERIALIZE_STATE_IN_SESSION parameter to false , you can disable serializing the state in
session, which will give better performance as well, as follows.
<?xml version="1.0" encoding="UTF-8"?>
<web-app ...>
...
<context-param>
<param-name>
org.apache.myfaces.SERIALIZE_STATE_IN_SESSION
</param-name>
 
Search WWH ::




Custom Search