Package org.springframework.web
Class HttpMediaTypeException
java.lang.Object
java.lang.Throwable
java.lang.Exception
jakarta.servlet.ServletException
org.springframework.web.HttpMediaTypeException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
HttpMediaTypeNotAcceptableException
,HttpMediaTypeNotSupportedException
Abstract base for exceptions related to media types. Adds a list of supported
MediaTypes
.- Since:
- 3.0
- Author:
- Arjen Poutsma
- See Also:
-
Constructor Summary
ModifierConstructorDescriptionprotected
HttpMediaTypeException
(String message) Create a new HttpMediaTypeException.protected
HttpMediaTypeException
(String message, List<MediaType> supportedMediaTypes) Create a new HttpMediaTypeException with a list of supported media types. -
Method Summary
Modifier and TypeMethodDescriptionReturn the list of supported media types.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
-
Constructor Details
-
HttpMediaTypeException
Create a new HttpMediaTypeException.- Parameters:
message
- the exception message
-
HttpMediaTypeException
Create a new HttpMediaTypeException with a list of supported media types.- Parameters:
supportedMediaTypes
- the list of supported media types
-
-
Method Details
-
getSupportedMediaTypes
Return the list of supported media types.
-