Package org.springframework.web.bind
Class MissingRequestCookieException
java.lang.Object
java.lang.Throwable
java.lang.Exception
jakarta.servlet.ServletException
org.springframework.web.util.NestedServletException
org.springframework.web.bind.ServletRequestBindingException
org.springframework.web.bind.MissingRequestValueException
org.springframework.web.bind.MissingRequestCookieException
- All Implemented Interfaces:
Serializable
,ErrorResponse
ServletRequestBindingException
subclass that indicates
that a request cookie expected in the method parameters of an
@RequestMapping
method is not present.- Since:
- 5.1
- Author:
- Juergen Hoeller
- See Also:
-
Constructor Summary
ConstructorDescriptionMissingRequestCookieException
(String cookieName, MethodParameter parameter) Constructor for MissingRequestCookieException.MissingRequestCookieException
(String cookieName, MethodParameter parameter, boolean missingAfterConversion) Constructor for use when a value was present but converted tonull
. -
Method Summary
Modifier and TypeMethodDescriptionfinal String
Return the expected name of the request cookie.Return the detail message, including the message from the nested exception if there is one.final MethodParameter
Return the method parameter bound to the request cookie.Methods inherited from class org.springframework.web.bind.MissingRequestValueException
isMissingAfterConversion
Methods inherited from class org.springframework.web.bind.ServletRequestBindingException
getBody, getRawStatusCode
Methods inherited from class jakarta.servlet.ServletException
getRootCause
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, 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, getStatus
-
Constructor Details
-
MissingRequestCookieException
Constructor for MissingRequestCookieException.- Parameters:
cookieName
- the name of the missing request cookieparameter
- the method parameter
-
MissingRequestCookieException
public MissingRequestCookieException(String cookieName, MethodParameter parameter, boolean missingAfterConversion) Constructor for use when a value was present but converted tonull
.- Parameters:
cookieName
- the name of the missing request cookieparameter
- the method parametermissingAfterConversion
- whether the value became null after conversion- Since:
- 5.3.6
-
-
Method Details
-
getMessage
Description copied from class:NestedServletException
Return the detail message, including the message from the nested exception if there is one.- Overrides:
getMessage
in classNestedServletException
-
getCookieName
Return the expected name of the request cookie. -
getParameter
Return the method parameter bound to the request cookie.
-