Top Description Methods
jakarta.servlet.annotation

public @Interface MultipartConfig

extends Annotation
Annotations
@Target:TYPE
@Retention:RUNTIME
Imports
java.lang.annotation.ElementType, .Retention, .RetentionPolicy, .Target

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

jakarta.servlet.http.Part components of a given multipart/form-data request are retrieved by a Servlet annotated with MultipartConfig by calling jakarta.servlet.http.HttpServletRequest#getPart or jakarta.servlet.http.HttpServletRequest#getParts.

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

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the size threshold at which the file will be written to the disk
fileSizeThreshold
()

public String

Returns:

location in which the Container stores temporary files
location
()

public long

Returns:

the maximum size allowed for uploaded files (in bytes)
maxFileSize
()

public long

Returns:

the maximum size of the request allowed for multipart/form-data
maxRequestSize
()

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

fileSizeThresholdback to summary
public int fileSizeThreshold()
Returns:int

the size threshold at which the file will be written to the disk

locationback to summary
public String location()
Returns:String

location in which the Container stores temporary files

maxFileSizeback to summary
public long maxFileSize()
Returns:long

the maximum size allowed for uploaded files (in bytes)

maxRequestSizeback to summary
public long maxRequestSize()
Returns:long

the maximum size of the request allowed for multipart/form-data