aspose file tools*
The moose likes Tomcat and the fly likes How to restrict no of requests? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "How to restrict no of requests?" Watch "How to restrict no of requests?" New topic
Author

How to restrict no of requests?

narender kaasam
Greenhorn

Joined: May 15, 2006
Posts: 28
Hi All
How to restrict(stop) no of requests to a perticular application in Tomcat deployment?

For all the applications in tomcat we can using server.xml,But perticular application i don't know could you tell me this?

[ May 16, 2006: Message edited by: narender kaasam ]
[ May 16, 2006: Message edited by: Bear Bibeault ]
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12789
    
    5
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
narender kaasam
Greenhorn

Joined: May 15, 2006
Posts: 28
how wecan restrict no of user using filters ? could you explain me clearly?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

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.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to restrict no of requests?