2013-05-21 15 views
0

在我的web項目中,大部分的網頁都使用搜索範圍內管理豆。 它的工作很好,但有時,我注意到,如果我從網頁的時間一樣,10分鐘後,當我返回到頁面了,一切都在頁面停止工作,並沒有控制檯錯誤在所示服務器。 我認爲這是由於一個觀點的生活,但沒有發現任何關於它。 我在哪裏可以找到關於它的信息? 有沒有辦法配置視圖的生存時間?約觀看時長/續航時間有些問題

我使用Apache Tomcat 7 下面是我的web.xml配置文件:

<?xml version="1.0" encoding="UTF-8"?> 
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" 
id="WebApp_ID" version="3.0"> 
<display-name>AtualyGestao</display-name> 
<welcome-file-list> 
    <welcome-file>index.html</welcome-file> 
    <welcome-file>index.htm</welcome-file> 
    <welcome-file>index.jsp</welcome-file> 
    <welcome-file>default.html</welcome-file> 
    <welcome-file>default.htm</welcome-file> 
    <welcome-file>default.jsp</welcome-file> 
    <welcome-file>index.jsf</welcome-file> 
</welcome-file-list> 
<servlet> 
    <servlet-name>Faces Servlet</servlet-name> 
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> 
    <load-on-startup>1</load-on-startup> 
</servlet> 
<servlet-mapping> 
    <servlet-name>Faces Servlet</servlet-name> 
    <url-pattern>*.jsf</url-pattern> 
</servlet-mapping> 
<context-param> 
    <param-name>primefaces.THEME</param-name> 
    <param-value>home</param-value> 
</context-param> 

回答

1

您應該看到它,如果你有留意Ajax請求的HTTP響應在瀏覽器的開發工具集(在Chrome /螢火蟲/ IE9按F12):

enter image description here

事實上,塞西已過期。關於爲什麼這是JSF問題的詳細解釋可以在這個答案中找到:javax.faces.application.ViewExpiredException: View could not be restored

JSF Ajax請求在默認情況下沒有任何形式的反饋異常情況。如何解決這個問題已經在這裏回答:Session timeout and ViewExpiredException handling on JSF/PrimeFaces ajax request

+0

但沒有生命時間配置?如果想讓頁面在失去會話之前活躍更多時間,該怎麼辦? –

+0

這只是'web.xml'中的標準Servlet API會話超時配置。另請參閱http://stackoverflow.com/questions/7449468/default-session-expiration-timeout/7449488#7449488。這更與JSF無關。 – BalusC