How to Limit Number of Users Logging into the application?

643 views Asked by At

I have made an application in Java(Struts Framework).

Is there a direct way or web.xml mapping or something else from where i can restrict the number of users logged in my application.

At present, I want only 2 users to login in my web application. Also, i can change the number any time. so want to make it a dynamic application.

P.S. : Don't want to use the traditional servlet concept of static variable and all as its creating problem in my application.

1

There are 1 answers

2
AudioBubble On

So our goal is to store the current number of logged in user, be able to read it, and be able to modify it by some means. We have a number of alternatives to static variable:

  • Store the number in an ordinary file in file system
  • Store the number in a database engine data table
  • Run an external memory cache