GWT客户端中的会话管理 [英] Session management in GWT client side
问题描述
我正在构建一个GWT应用程序,其中有3个RootPanels,其中一个包含登录面板(userId和Password).我的应用程序是一页应用程序.为了登录,用户名和密码是通过RPC从服务器上更改的,如果组合正确,则将加载下一个面板,这是我的主要应用程序.由于它是一页应用程序,因此我想知道如何在此应用程序中进行会话管理.
I am building a GWT application where I have 3 RootPanels one of which contains the login panel (userId and Password). My application is a one page application. In order to login the user's id and password is varified from the server through RPC and if the combination is correct the next Panel loads which is my main application. Since it is a one page application, I want to know how should I carry out session management in this application.
推荐答案
在不同的GWT应用程序中使用的几种方法
Few ways I used in my different GWT applications
- 在每个RPC(客户端/服务器)上检查用户的凭据.遵循通用 编程(每个RPC中明显的时间延迟:-/)
- 使用
Thread Local
(首选方式)
- Checking user's credentials on each RPC (client/server). Follow generic programming (obvious time delay in each RPC :-/)
- Using
Thread Local
(preferred way)
getThreadLocalRequest().getSession().setAttribute("user", user);
//and get
- 使用Cookies允许用户的网络浏览器记住"登录名.
- 我不使用的其他人很少.例如:本地存储(
not secured, dependent
)
这篇关于GWT客户端中的会话管理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!