tags:

views:

41

answers:

2

I am developing a swing based DEFECT TRACKER application. Now 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.

Thanks for your help :)

A: 

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.

Ravi Gummadi
Ok...I do not know how this works..... The user performs no action before loging in...he/she logs in with the user ID password combination....So how do I maintain a session based on the login ID provided on the first frame...I will have to keep a track right of the user throusg out the session..... How do I propogate the value to other screens....Thanks :)
sandhya
Declare a custom "Session" class and whenever a user logs in, create a "Session" object and store the User->Session association. Now pass the Session object to other screens as they are called. You would have to change all the screen calling logic, so that you can pass the Session info. There might be a more efficient way of doing this!
Ravi Gummadi
class session{ public username;getter(); setter();}Do you mean setting and accessing values like this....It would help if u have a sample code...Thanks for your help....:)
sandhya
A: 

class session{ public username;

getter(); setter();

}

Do you mean setting and accessing values like this....It would help if u have a sample code...

Thanks for your help....:)

sandhya

related questions