Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p><em>Other than session expiration, what other conditions might cause ViewExpiredException?</em></p> </blockquote> <p>The enduser has requested/created too much views within a session and is submitting to an old view. The default max views per session is 15. In other words, if the enduser opens 16 browser windows/tabs on a page with a form within the same session and submits to the first one, then the user can get <code>ViewExpiredException</code>.</p> <p>The max views per session is configureable in <code>web.xml</code> by </p> <pre><code>&lt;context-param&gt; &lt;param-name&gt;com.sun.faces.numberOfViewsInSession&lt;/param-name&gt; &lt;param-value&gt;15&lt;/param-value&gt; &lt;/context-param&gt; </code></pre> <p>See also <a href="https://wikis.oracle.com/display/GlassFish/JavaServerFacesRI#JavaServerFacesRI-Whatcontextparametersareavailableandwhatdotheydo%3F" rel="nofollow noreferrer">Mojarra FAQ</a> for other parameters.</p> <hr> <blockquote> <p><em>Is there a way to introduce additional logging to find out the very specific situation that is triggering this exception in each case?</em></p> </blockquote> <p>Not through JSF and/or a <code>ViewExpiredException</code>. The whole exception just means that the view is not present in the session anymore. This can in turn indeed have more underlying causes. Logging the session creation and destroy using a <a href="http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpSessionListener.html" rel="nofollow noreferrer"><code>HttpSessionListener</code></a> and logging the session attribute modifications by <a href="http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpSessionAttributeListener.html" rel="nofollow noreferrer"><code>HttpSessionAttributeListener</code></a> may be helpful.</p> <hr> <p><strong>Update</strong> as per the comments, pressing the browser back button on a cached page containing a form and then submitting the form thereafter could indeed also cause <code>ViewExpiredException</code> when the view is been expired. This can be solved in following two ways, preferably in a combination of them:</p> <ul> <li>Instruct the browser to <strong>not</strong> cache the pages.</li> <li>Do <strong>not</strong> use POST forms for plain page-to-page navigation.</li> </ul> <p>For more detail, see <a href="https://stackoverflow.com/questions/3642919/javax-faces-application-viewexpiredexception-view-could-not-be-restored/3642969#3642969">this answer</a>.</p>
    singulars
    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.
 

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