How to configure number of views in session – Perfomance tuning in JSF

JSF will maintain all its views & its state in HTTP session object if state saving method is server which will cause increased usage of memory. To avoid it, we can minimize the number of views stored in session which suits to the application need that can be defined in web.xml given below

<context-param>
 <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
 <param-value>server</param-value>
</context-param>

<context-param>
 <param-name>com.sun.faces.numberOfViewsInSession</param-name>
 <param-value>3</param-value>
</context-param>

<context-param>
 <param-name>com.sun.faces.numberOfLogicalViews</param-name>
 <param-value>10</param-value>
</context-param>

numberOfViewsInSession defines the number of view states (pages) to support back button operation.

numberOfLogicalViews defines the number of logical views (frames) that can present in a page.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: