Package org.springframework.web.bind
Class MissingRequestHeaderException
- 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.MissingRequestHeaderException
- All Implemented Interfaces:
Serializable
public class MissingRequestHeaderException extends ServletRequestBindingException
ServletRequestBindingException
subclass that indicates that a request header expected in the method parameters of an@RequestMapping
method is not present.- Since:
- 5.1
- Author:
- Juergen Hoeller
- See Also:
MissingRequestCookieException
, Serialized Form
Constructor Summary
Constructors Constructor Description MissingRequestHeaderException(String headerName, MethodParameter parameter)
Constructor for MissingRequestHeaderException.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getHeaderName()
Return the expected name of the request header.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 header.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
MissingRequestHeaderException
public MissingRequestHeaderException(String headerName, MethodParameter parameter)
Constructor for MissingRequestHeaderException.- Parameters:
headerName
- the name of the missing request headerparameter
- 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
getHeaderName
public final String getHeaderName()
Return the expected name of the request header.
getParameter
public final MethodParameter getParameter()
Return the method parameter bound to the request header.