Is there analog of PHP "MAX_FILE_SIZE" parameter for JSP?
It's needed to perform validation on UI before upload process triggered on backend.
The setSizeMax() method in Apache Commons FileUpload's ServletFileUpload class lets you set the maximum size to accept in the request. If the request body is larger than the max, it will throw a SizeLimitExceededException. Details at http://commons.apache.org/fileupload/.