开发者

session management in swing based applications

I am developing a swing based DEFECT TRACKER application.

The problem is I have to maintain user sessions. I do not have a clue how to do this. Many users may access the system simultaneously and enter their own data. This is a basic scenario seen at many places. 开发者_运维知识库 Like any login based application we have.


These are the following answers I can think of:

  1. If the user logs in before performing any activity, you could easily maintain session information based on the login ID.
  2. If there is no necessity for the user to login, you can track the clients connected at the entry point of your application and maintain a map of them. Since each user is not logging in explicitly, you might want to track the clients based on the IP address they are logging in from.
  3. You could assign each Swing client downloaded an unique GUID and send that along with each request.

Of course, the caveat is if there are a lot of concurrent users accessing the system, you have to implement a queuing system and also make sure that your server code is thread safe.

A completely different approach is use to JSPs or Servlets.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜