Top Description Fields Constructors Methods
org.springframework.web.multipart.support

public Class MissingServletRequestPartException

extends ServletException
implements ErrorResponse
Class Inheritance
All Implemented Interfaces
org.springframework.web.ErrorResponse
Annotations
@SuppressWarnings:serial
Imports
jakarta.servlet.ServletException, org.springframework.http.HttpStatus, .HttpStatusCode, .ProblemDetail, org.springframework.web.ErrorResponse, org.springframework.web.multipart.MultipartResolver

Signals the part of a "multipart/form-data" request, identified by name could not be found. This may be because the request is not a multipart request, or a part with that name is not present, or because the application is not configured correctly for processing multipart requests, e.g. there is no MultipartResolver.

Note

This exception does not extend from org.springframework.web.bind.ServletRequestBindingException because it can also be raised at a lower level, i.e. from this package which does low level multipart request parsing, independent of higher level request binding features.

Author
Rossen Stoyanchev
Since
3.1

Field Summary

Modifier and TypeField and Description
private final ProblemDetail
private final String

Constructor Summary

AccessConstructor and Description
public
MissingServletRequestPartException(String
the name of the missing part of the multipart request
requestPartName
)

Constructor for MissingServletRequestPartException.

Method Summary

Modifier and TypeMethod and Description
public ProblemDetail
getBody()

Implements org.springframework.web.ErrorResponse.getBody.

Return the body for the response, formatted as an RFC 7807 ProblemDetail whose status should match the response status.

public Object[]
getDetailMessageArguments()

Overrides default org.springframework.web.ErrorResponse.getDetailMessageArguments.

Return arguments to use along with a message code to resolve the problem "detail" for this exception through a MessageSource.

public String
getRequestPartName()

Return the name of the offending part of the multipart request.

public HttpStatusCode
getStatusCode()

Implements org.springframework.web.ErrorResponse.getStatusCode.

Return the HTTP status code to use for the response.

Inherited from jakarta.servlet.ServletException:
getRootCause

Field Detail

bodyback to summary
private final ProblemDetail body
requestPartNameback to summary
private final String requestPartName

Constructor Detail

MissingServletRequestPartExceptionback to summary
public MissingServletRequestPartException(String requestPartName)

Constructor for MissingServletRequestPartException.

Parameters
requestPartName:String

the name of the missing part of the multipart request

Method Detail

getBodyback to summary
public ProblemDetail getBody()

Implements org.springframework.web.ErrorResponse.getBody.

Return the body for the response, formatted as an RFC 7807 ProblemDetail whose status should match the response status.

Annotations
@Override
getDetailMessageArgumentsback to summary
public Object[] getDetailMessageArguments()

Overrides default org.springframework.web.ErrorResponse.getDetailMessageArguments.

Doc from org.springframework.web.ErrorResponse.getDetailMessageArguments.

Return arguments to use along with a message code to resolve the problem "detail" for this exception through a MessageSource. The arguments are expanded into placeholders of the message value, e.g. "Invalid content type {0}".

Annotations
@Override
getRequestPartNameback to summary
public String getRequestPartName()

Return the name of the offending part of the multipart request.

getStatusCodeback to summary
public HttpStatusCode getStatusCode()

Implements org.springframework.web.ErrorResponse.getStatusCode.

Return the HTTP status code to use for the response.

Annotations
@Override