Hello everyone, I'm developing the struts 2 application, in that i want to develop such application in that at the same time the same user data can not use two browser for LOGIN, I'm trying to use the actioncontext for that but not success that code....please give me the code for such that application....Thank you in advance
I've added the code tags for you. As far as the feature, it isn't a trivial thing that you can use a listener and be done with it.
You need to keep track of who is logged in. If you only have one clone, this can be done in memory. Otherwise, you need an external datastore like a database table.
When a user logs in, you need to decide what to do. If the user is already logged in, what do you want to do? You might automatically logout the old session. You might ask the user if they want to logout the old session.
Keep in mind that you don't always know when a user logs out. You might have to wait for session timeout. Hence the inclination to logout the old user.