Class MissingServletRequestPartException
java.lang.Object
java.lang.Throwable
java.lang.Exception
jakarta.servlet.ServletException
org.springframework.web.multipart.support.MissingServletRequestPartException
- All Implemented Interfaces:
Serializable
,ErrorResponse
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
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.
- Since:
- 3.1
- Author:
- Rossen Stoyanchev
- See Also:
-
Constructor Summary
ConstructorDescriptionMissingServletRequestPartException
(String requestPartName) Constructor for MissingServletRequestPartException. -
Method Summary
Modifier and TypeMethodDescriptiongetBody()
Return the body for the response, formatted as an RFC 7807ProblemDetail
whosestatus
should match the response status.Return the name of the offending part of the multipart request.Return the HTTP status code to use for the response.Methods inherited from class jakarta.servlet.ServletException
getRootCause
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.web.ErrorResponse
getHeaders
-
Constructor Details
-
MissingServletRequestPartException
Constructor for MissingServletRequestPartException.- Parameters:
requestPartName
- the name of the missing part of the multipart request
-
-
Method Details
-
getRequestPartName
Return the name of the offending part of the multipart request. -
getStatusCode
Return the HTTP status code to use for the response.- Specified by:
getStatusCode
in interfaceErrorResponse
-
getBody
Return the body for the response, formatted as an RFC 7807ProblemDetail
whosestatus
should match the response status.- Specified by:
getBody
in interfaceErrorResponse
-