2013-05-03 177 views
0

當用戶在特定時間間隔內未使用應用程序時,我需要將應用程序發出會話。爲此,我在web.xml中配置了會話超時時間,但不工作。會話在GWT web.xml中處於非活動狀態

<session-config> 
    <session-timeout>1</session-timeout> 
</session-config> 

請幫我

回答

1

GWT被編譯成JavaScript和運行在瀏覽器,這樣,會話超時將有當您使用Servlet過濾器

+0

其實我的需求是什麼,我需要在用戶不使用應用程序時不要觸摸應用程序。那麼我必須重定位到登錄頁面,這是一個HTML頁面。我在這裏完成的是...我創建一個GWT客戶端應用程序並將編譯的文件夾粘貼到android項目資源文件夾中。我通過web視圖調用GWT應用程序。 – kader 2013-05-03 13:38:24

0
作出GWT-RPC調用將被處理

當您在web.xml提到超時並嘗試訪問超時

異常類型RequestTimeoutException通過contianer拋出後

拋出以表明HTTP請求已超時。

不要忘記添加

<module> 
    <!-- other inherited modules, such as com.google.gwt.user.User --> 
    <inherits name="com.google.gwt.http.HTTP"/> 
    <!-- additional module settings --> 
</module> 

看到這個處理是在客戶端How to handle a session timeout exception (with MVP Places and Activities)?

0

你必須做一些機制來實現它。

i need to sesssion out when user not use the application like not touch the application.

正如你知道,如果你沒有一些頁面上工作,所以沒有任何鼠標移動。所以你可以做些什麼。

我有同樣的要求,我也喜歡這樣做參考Mouse movement for session timeout in GWT

i create one GWT client side application and paste the compiled folder in android project asset folder.i call GWT application through web view.

我沒有web視圖進行檢查。它應該工作!

+0

感謝妹妹..我試試 – kader 2013-05-06 06:24:19

+0

現在我嘗試實現你在這裏發佈的內容在GWT.how中使用會話工廠的會話超時的鼠標移動在GWT客戶端side.on頁面中,他提到在onmodule方法上寫代碼。但sessionfactory不會導入客戶端GWT.how有可能 – kader 2013-05-09 12:21:30

+0

SessionFactory不過是一個自定義映射,它具有一個鍵,如SesisonKey.CLIENT_SESSION_EXPIRED。而不是它,你可以使用任何布爾變量。 – iMBMT 2013-05-09 12:57:50

相關問題