How to reduce the size of AjaxStateHolder object in the session in JBoss EAP 5?

Solution Verified - Updated

Environment

  • JBoss Enterprise Application Platform (EAP) 5.0.1
  • RichFaces 3.3.1.SP2

Issue

  • The org.ajax4jsf.application.AjaxStateHolder object in session is too big. Can we reduce the size of this object?

Resolution

  • AjaxStateHolder is the Richfaces implementation of the JSF state saving manager. It stores the saved view state in this object.

  • Unfortunately there is no easy fix. This is how JSF works, and how A4J works. There is a Content from issues.jboss.org is not included.jira which describes this and the best answer is to reduce the number of views you store through the web.xml:

    <context-param>
     <description></description>
     <param-name>com.sun.faces.numberOfViewsInSession</param-name>
     <param-value>1</param-value>
     </context-param>
    <context-param>
     <description></description>
     <param-name>com.sun.faces.numberOfLogicalViews</param-name>
     <param-value>1</param-value>
    </context-param>
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.