1

I have no experience with session handling, and probably I'm just having a trouble getting the idea, but there is absolutely nowhere where the sessionId problem is explained.

First, I read this Google article and there is this statement:

String sessionID = /*(**Get sessionID from server's response to your
        login request.**)*/;"

So I started reading more, and I found this tutorial - very helpful one, but it contains this line:

String sessionID = result.getSessionId();

and I do not simply know what to do with it! I have no such method defined in my User object (which is a result from a server response here). I can create it, but I don't know what to write in it. How can I do this?

4

1 回答 1

1

在本教程中,UserDTO 只是将 sessionID 存储在来自 GXT 的 BaseModelData 的地图中。

您可以在以下位置查看此对象的代码:https ://code.google.com/p/yfs-health/source/browse/trunk/yfs/src/com/varun/yfs/dto/UserDTO.java

基本上,在本教程中 LoginServiceImpl 的第 8 行登录期间,UserDTO 对象会填充来自 HttpThreadLocalRequest 的这些数据。

您实际上可以在这里看到它,会话 id 是通过分析 servlet 实现中的请求来设置的: user.setSessionId(this.getThreadLocalRequest().getSession().getId());

于 2013-02-27T21:05:35.237 回答