2012-09-20 97 views
7

我有我無法解決的問題。當我打開刷新JSF頁面後,頁面閒置例如,10分鐘,我收到此錯誤信息:查看/page.jsf無法恢復

serverError: class javax.faces.application.ViewExpiredException viewId:/page.jsf - View /page.jsf could not be restored. 

我怎樣才能增加JSF的時間:

回答

19

你可以這樣

<session-config> 
    <session-timeout>45</session-timeout> 
</session-config> 

會話超時參數設定爲45分鐘,以web.xml中你也可以很容易地通過添加以下代碼到你的web.xml處理這個例外在一個單獨的頁面

<error-page> 
    <exception-type>javax.faces.application.ViewExpiredException</exception-type> 
    <location>/exception/sessionexpired.xhtml</location> 
</error-page> 
+0

當發生這種情況時,是否可以強制刷新頁面? – user1156544