Package org.springframework.web.bind
Class MissingRequestCookieException
- java.lang.Object
- java.lang.Throwable
- java.lang.Exception
- javax.servlet.ServletException
- org.springframework.web.util.NestedServletException
- org.springframework.web.bind.ServletRequestBindingException
- org.springframework.web.bind.MissingRequestCookieException
- All Implemented Interfaces:
Serializable
public class MissingRequestCookieException extends ServletRequestBindingException
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:
MissingRequestHeaderException
, Serialized Form
Constructor Summary
Constructors Constructor Description MissingRequestCookieException(String cookieName, MethodParameter parameter)
Constructor for MissingRequestCookieException.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getCookieName()
Return the expected name of the request cookie.String
getMessage()
Return the detail message, including the message from the nested exception if there is one.MethodParameter
getParameter()
Return the method parameter bound to the request cookie.Methods inherited from class javax.servlet.ServletException
getRootCause
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Constructor Detail
MissingRequestCookieException
public MissingRequestCookieException(String cookieName, MethodParameter parameter)
Constructor for MissingRequestCookieException.- Parameters:
cookieName
- the name of the missing request cookieparameter
- the method parameter
Method Detail
getMessage
public String 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
public final String getCookieName()
Return the expected name of the request cookie.
getParameter
public final MethodParameter getParameter()
Return the method parameter bound to the request cookie.