Re: Servlets / How can we discard a request?



Daniel Pitts wrote:
On Mar 9, 6:36 pm, Covington Bradshaw <cog.b...@xxxxxxxxxxxxx> wrote:
Hi,
In a servlet filter or servlet, how can we discard a request?
I.E. receive a given http request and simply decide to reject it
without answering the client with any response.

Well, at the worst, you should return a 404 response. Its only polite.
If you don't want any response, why have a servlet at all?

Or one of the other 4xx or 5xx responses. I agree that it makes no sense not
to respond at all -- if there's a reason why the server doesn't want to service
this request then it should /say/ so.

And, anyway, if the server just drops the connection without sending a standard
HTTP response, then the client will almost certainly retry -- thus increasing
the load on your server...

-- chris


.



Relevant Pages

  • Re: Request for suggestions re: architecture of IntraNet/Socket app[s]
    ... Your Ajax routine could be used to call an ISAPI dll from the browser, ... Here is the Simple Java Servlet ... @param request servlet request ... @param response servlet response ...
    (borland.public.delphi.non-technical)
  • Re: W2K3 IIS 6.0 ASP.NET Requests Per Second Limits?
    ... Web Page makes HTTP request to web service ... Web Page waits for HTTP response to return ... Since ASP.Net depends on the worker threads to "do work", ...
    (microsoft.public.inetserver.iis)
  • Re: W2K3 IIS 6.0 ASP.NET Requests Per Second Limits?
    ... I think I grasp the concept between the two scenarios sync and async. ... Web Page displays the content of the HTTP response ... Now with this example when I send the request to temperature webservice ... > queue's up the HTTP request and immediately returns back and can ...
    (microsoft.public.inetserver.iis)
  • Re: Servlet To Java Application Communication
    ... I would like to write a Java servlet that it will be able to ... way to communicate with a servlet. ... probably know you should encode the request XML in the body part of a POST ... and expect the response XML in the response content. ...
    (comp.lang.java.databases)
  • Problem with XMLHTTP responseText empty
    ... I've implemented a FileUpload servlet using AJAX and JS. ... the response in Javascript and write it out to a field on my webpage. ... // first check if the upload request coming in is a multipart ...
    (comp.lang.javascript)