I've been looking around for something to break down my request when an exception is thrown. I have a file upload in my jsp which can't be more than 2MB. There is jsp validation but there has to be an extra safety for when internet explorer 8 or 9 is being used because the file API is not supported there or when javascript is being disabled client side.
I have a CommonMultipartResolver from spring which correctly handles my request when uploading a bigger file (it throws a MaxUploadSizeExceededException). When my ExceptionResolver handles the request and sends back a ModelAndView.
The real problem occurs when I upload a file which is for example 4GB. The exception is thrown by the multipartResolver, the exception is caught by the exceptionhandler and a modelAndView is trying to be returned. This trying to return the modelAndView takes ages to return because the request is being handled and the file has to be fully uploaded.
I want to break down my request and stop handling the file upload, someone with experience in doing this?