I checked the spec for file uploading support in Servlet 3.0, please refer to the text below :
If a request is of type multipart/form-data and if the servlet handling the
request is annotated using the @MultipartConfig as defined in Section 8.1.5,
"@MultipartConfig" on page 8-64, the HttpServletRequest can make available
the various parts of the multipart request via the following methods
■ public Collection<Part> getParts()
■ public Part getPart(String name).
This annotation, when specified on a Servlet, indicates that the request it expects
is of type mime/multipart. The HttpServletRequest object of the
corresponding servlet MUST make available the mime attachments via the
getParts and getPart methods to iterate over the various mime attachments.
From my understanding, the two methods are expected to invoke in the Servlet, also, those two methods should be avaible when both the conditions are fullfilled :
b. MultipartConfig is configued
Seems that Tomcat strictly actions accroding to the spec. I also check the Jetty's implementation, it seems that Jetty is more tolerant, it might make the getPart/getParts avaible when the mutlpart form data is detected.
Please correct me if I misundstand anything !