This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
This sounds like a job for a Filter - see the javax.servlet.Filter interface Javadocs to start off. Do you want to "throttle" the requests so that extra requests wait their turn or discard the request with a "Try later" approach? Bill
Joined: May 15, 2006
how wecan restrict no of user using filters ? could you explain me clearly?
Let's start with you telling us exactly what you're trying to do?
Are you trying to limit the number of sessions? Does your app use sessions? If so, are you sticking with the default timeout of 30 minutes or do you need to change it?
If this isn't to be tied to sessions, are you trying to limit the number of concurrent hits or the number of hits over a given amount of time? If the latter, what is the amount of time.
As William asked: What is the behaviour you want your app to exibit when someone tries to hit your app after the max number of hits has taken place?
There are several approaches you could take and nobody wants to explain all of them in detail (at least not here). Let us know exactly what your needs are and someone will be sure to suggest a path for you to follow.