How to filter out duplicated request using Apache or TomCat

2003-02-06 Thread Bing Zhang

If the same user clicks a button continuously or refresh a page constantaly,
that will generate the same request to our server many times with a tiny
short interval. And the request will all come from the same machine. Is
there a way to block these kind of requests by configuring the Apache or
TomCat ?

Bing

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: How to filter out duplicated request using Apache or TomCat

2003-02-06 Thread Rob Simpson

You do that in the Servlet, by creating an instance of a Request object in
the doGet and/or doPost method.  Then each request will have its own copy of
data.  If you want, you can count the number of active requests and display
a message to the user that basically says be more patient! (I've done that
in the iToolSet - see below).

Rob Simpson



/**
 * Handle a GET request.
**/

   public void doGet(final HttpServletRequest request, final
HttpServletResponse response)
//  throws IOException, ServletException
   {
  processRequest(request, response);
   }

/**
 * Handle a POST request.
**/

   public void doPost(final HttpServletRequest request, final
HttpServletResponse response)
//  throws IOException, ServletException
   {
  processRequest(request, response);
   }

/**
 * Processes the request.
**/

   public void processRequest(final HttpServletRequest request, final
HttpServletResponse response)
//  throws IOException, ServletException
   {

   // Check for request already in progress

  requestsInProgress ++;
  // could be incremented in the handleRequest call, but done here
  // just in case some implementation does the post increment after
  // returning from the call to handleRequest

   // Handle this request

  TextRequestHandler requestHandler = createRequestHandler(servletTool,
new RequestData(toolset, this, request, response, requestsInProgress));
requestHandler.addUserMessage(user message);
requestHandler.addFooterMessage(requestsInProgress= +
Integer.toString(requestsInProgress));
  requestHandler.printHeader();
  requestHandler.handleRequest();
  requestHandler.printFooter();

  requestsInProgress --;
   }

// Abstract methods

   public abstract TextRequestHandler createRequestHandler(ServletTool
servletTool, RequestData requestData);


-Original Message-
From: Bing Zhang [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 06, 2003 1:48 PM
To: 'Tomcat Users List'
Cc: Jimmy Wu; Dan Yin; Daniel Ruiz
Subject: How to filter out duplicated request using Apache or TomCat



If the same user clicks a button continuously or refresh a page constantaly,
that will generate the same request to our server many times with a tiny
short interval. And the request will all come from the same machine. Is
there a way to block these kind of requests by configuring the Apache or
TomCat ?

Bing

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




This email and any files transmitted with it are confidential and are
intended for the sole use of the individual to whom they are addressed.
Black Box Corporation reserves the right to scan all e-mail traffic for
restricted content and to monitor all e-mail in general. If you are not the
intended recipient or you have received this email in error, any use,
dissemination or forwarding of this email is strictly prohibited. If you
have received this email in error, please notify the sender by replying to
this email.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]