javax.servlet.annotation
Annotation Type MultipartConfig


@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface MultipartConfig

This annotation is used to indicate that the Servlet on which it is declared expects requests to made using the multipart/form-data MIME type.

Part components of a given multipart/form-data request are retrieved by a Servlet annotated with MultipartConfig by calling HttpServletRequest.getPart(java.lang.String) or HttpServletRequest.getParts().

E.g. @WebServlet("/upload")}
@MultipartConfig() public class UploadServlet extends HttpServlet ... }

Since:
Servlet 3.0

Optional Element Summary
 int fileSizeThreshold
           
 String location
           
 long maxFileSize
           
 long maxRequestSize
           
 

location

public abstract String location
Returns:
location in which the Container stores temporary files
Default:
""

maxFileSize

public abstract long maxFileSize
Returns:
the maximum size allowed for uploaded files (in bytes)
Default:
-1L

maxRequestSize

public abstract long maxRequestSize
Returns:
the maximum size of the request allowed for multipart/form-data
Default:
-1L

fileSizeThreshold

public abstract int fileSizeThreshold
Returns:
the size threshold at which the file will be written to the disk
Default:
0

(Built by coreservlets)

As of July 2010, there were no online versions of the servlet 3.0, JSP 2.2, and EL 2.2 Javadocs, except as part of the huge Java EE 6 API. So, I built them myself from the Tomcat 7 source code.

Java EE TutorialsJava EE Training