MaxUploadSizeExceededException exception appears when I upload a file whose size exceeds the maximum allowed. I want to show an error message when this exception appears (like a validation error message). How can I handle this exception to do something like this in Spring 3?
Thanks.
I finally figured out a solution that works using a HandlerExceptionResolver.
Add multipart resolver to your Spring config:
Model – UploadedFile.java:
View – /upload.jsp:
Controller – FileUploadController.java:
package com.mypkg.controllers;