This annotation can also specify location to store the file on server, maxFileSize allowed for uploaded files, maxRequestSize allowed for multipart/form-data requests, and fileSizeThreshold after exceeding it the file content will be written on the disk.Ģ. Having this annotation on the top of a servlet indicates that the Request that the servlet is expecting will have multipart/form-data MIME data. The new Servlets have inbuilt support for File Upload. Let’s have quick look at these annotations.ġ. The Annotation based configurations makes the code more readable and also saves us from maintaining nasty and cumbersome deployment descriptors. We can still keep the deployment descriptor and override the existing mappings, and other configurations. Servlets 3.0 have come up with a set of new Annotations for the declarations of Request Mappings, Init-Params, Listeners, and Filters that makes the use of Deployment Descriptor (web.xml) absolutely optional.