Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>JSF is a useful technology, but you can certainly hang yourself with it.</p> <p>It sounds like, either you're inflating the size of the view state (by setting large values on components) or you're leaking references to components into other session state (which would be bad). Another potential culprit would be an excessively large view (I've seen the ease with which people can build UI trees lead to very big control graphs with data tables everywhere). I know that IBM provides rich text and spreadsheet controls - I can't comment on what effect the use of these will have on state size.</p> <p>The low hanging fruit is to check the managed beans configured for session scope in <em>faces-config.xml</em>.</p> <p>JSF saves two things between requests:</p> <ul> <li>the view (all the controls on the page)</li> <li>the view state (the state of the controls)</li> </ul> <p>These are separated because some controls, such as children of a data table, can have multiple states (one for each row). State can be saved to either a hidden field on the form (which, if unencrypted, can be a big security hazard) or in the session. In order to accommodate multiple browser windows sharing the same session (and, in some implementations, back button support), multiple views are stored.</p> <ul> <li>There should be a configuration option to set the number of view states the app will keep in the session for a given user at any given time.</li> <li>You can measure the size of view state by providing a <a href="http://java.sun.com/javaee/5/docs/api/javax/faces/application/StateManagerWrapper.html" rel="noreferrer">StateManager</a> that measures the size of the saved view/state (configure a StateManager in faces-config.xml with a public constructor that takes a StateManager - see the <a href="http://java.sun.com/javaee/javaserverfaces/reference/api/index.html" rel="noreferrer">JSF spec</a> PDFs for more details; the state is serializable and you can check its size by dumping it to a stream).</li> </ul> <p>Most IDE-built JSF apps have backing beans. It would be possible, via session bean scope to hold onto state longer than you want, placing a strain on the session. Since there tends to be one backing bean per page, the more pages you have, the bigger the problem will be. Check your <em>faces-config.xml</em> to see if this is a potential source of problems.</p> <p>Something else you could do would be to configure a <a href="http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpSessionAttributeListener.html" rel="noreferrer">HttpSessionAttributeListener</a> in your <em>web.xml</em>. You can get a <a href="http://java.sun.com/javase/6/docs/api/java/lang/Thread.html#getStackTrace()" rel="noreferrer">stack trace</a> to help identify problem areas in your app.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload