Re: [s1] Filters: distinguishing between user-requests and redirects

2007-03-14 Thread Pierre Thibaudeau
2007/3/13, Michael Jouravlev [EMAIL PROTECTED]: On 3/13/07, Christopher Schultz [EMAIL PROTECTED] wrote: I am trying to implement a flood control mechanism to prevent robots requesting pages after pages at an inhuman rate. I know you've gotten lots of feedback already, but there's a

Re: [s1] Filters: distinguishing between user-requests and redirects

2007-03-13 Thread Tamas Szabo
Yes, setting the dispatcher will work just for ignoring the forwards, it won't work for redirects. You can check for attributes as Paul suggests, but setting the dispatcher seems to be easier if you have a servlet container supporting 2.4. You'll have to handle redirects in another way though. A

Re: [s1] Filters: distinguishing between user-requests and redirects

2007-03-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Pierre, I am trying to implement a flood control mechanism to prevent robots requesting pages after pages at an inhuman rate. I know you've gotten lots of feedback already, but there's a super-simple way to do this: put a marker in the request

Re: [s1] Filters: distinguishing between user-requests and redirects

2007-03-13 Thread Michael Jouravlev
On 3/13/07, Christopher Schultz [EMAIL PROTECTED] wrote: Pierre, I am trying to implement a flood control mechanism to prevent robots requesting pages after pages at an inhuman rate. I know you've gotten lots of feedback already, but there's a super-simple way to do this: put a marker in the

[s1] Filters: distinguishing between user-requests and redirects

2007-03-12 Thread Pierre Thibaudeau
I am trying to implement a flood control mechanism to prevent robots requesting pages after pages at an inhuman rate. My basic idea is this: * A FirstInFirstOut List stored in the HttpSession, that records the time of the user's last 10 requests. * On each new request, a filter compares the

Re: [s1] Filters: distinguishing between user-requests and redirects

2007-03-12 Thread Tamas Szabo
Hi, What servlet api are you using? Is it at least 2.4? Tamas On 3/13/07, Pierre Thibaudeau [EMAIL PROTECTED] wrote: I am trying to implement a flood control mechanism to prevent robots requesting pages after pages at an inhuman rate. My basic idea is this: * A FirstInFirstOut List stored

Re: [s1] Filters: distinguishing between user-requests and redirects

2007-03-12 Thread Pierre Thibaudeau
Yes, I believe it is 2.4. Also: Struts 1.3.5 Tomcat 6.0.9 2007/3/12, Tamas Szabo [EMAIL PROTECTED]: Hi, What servlet api are you using? Is it at least 2.4? Tamas On 3/13/07, Pierre Thibaudeau [EMAIL PROTECTED] wrote: I am trying to implement a flood control mechanism to prevent robots

Re: [s1] Filters: distinguishing between user-requests and redirects

2007-03-12 Thread Tamas Szabo
Have a look at the documentation of the dispatcherType at http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd. Then you can use dispatcher elements in your filter mappings (filter-mappingType in the same xsd) to fire your filter just for requests but not for forwards. I pressume that by internal

Re: [s1] Filters: distinguishing between user-requests and redirects

2007-03-12 Thread Pierre Thibaudeau
2007/3/13, Tamas Szabo [EMAIL PROTECTED]: Have a look at the documentation of the dispatcherType at http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd. Thank you, I'll take a look. I pressume that by internal redirects in your initial mail you mean forwards. Is this true? Sometimes

Re: [s1] Filters: distinguishing between user-requests and redirects

2007-03-12 Thread Paul Benedict
There is no technical difference between a user request and a redirect, because the redirect causes a second user request. If you're interested in knowing whether the action is being called as a forward, there are standard request attributes which the Container sets. For a forward it is