I am using ENCTYPE="multipart/form-data" in a form to upload files. I have
no problem with the upload itself. However, if I detect that the file being
uploaded is too big, or the server is too busy, I would like to terminate
the request from the user as quickly as possible. So far I have tried:
res.sendError(errorCode);
res.setStatus(statusCode);
res.sendRedirect(errorPage);
throw new ServletException(errorMessage);
In all cases Weblogic happily reads the entire upload before terminating the
request.
In Jason Hunter's book "Java Servlet Programming", he says (p119) "...many
servers implement a second option: try to send an error page, and forcefully
disconnect if necessary."
Does anybody know how to cause a servlet to "forcefully disconnect"? I have
also tried calling close on the request's InputStream, but that didn't help
either.
Thanks,
Ernie
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html