Package org.springframework.web.bind
Class MissingRequestHeaderException
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.MissingRequestHeaderException
- All Implemented Interfaces:
- Serializable
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:
- 
Constructor SummaryConstructorsConstructorDescriptionMissingRequestHeaderException(String headerName, MethodParameter parameter) Constructor for MissingRequestHeaderException.MissingRequestHeaderException(String headerName, MethodParameter parameter, boolean missingAfterConversion) Constructor for use when a value was present but converted tonull.
- 
Method SummaryModifier and TypeMethodDescriptionfinal StringReturn the expected name of the request header.Return the detail message, including the message from the nested exception if there is one.final MethodParameterReturn the method parameter bound to the request header.Methods inherited from class org.springframework.web.bind.MissingRequestValueExceptionisMissingAfterConversionMethods inherited from class jakarta.servlet.ServletExceptiongetRootCauseMethods inherited from class java.lang.ThrowableaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
- 
Constructor Details- 
MissingRequestHeaderExceptionConstructor for MissingRequestHeaderException.- Parameters:
- headerName- the name of the missing request header
- parameter- the method parameter
 
- 
MissingRequestHeaderExceptionpublic MissingRequestHeaderException(String headerName, MethodParameter parameter, boolean missingAfterConversion) Constructor for use when a value was present but converted tonull.- Parameters:
- headerName- the name of the missing request header
- parameter- the method parameter
- missingAfterConversion- whether the value became null after conversion
- Since:
- 5.3.6
 
 
- 
- 
Method Details- 
getMessageDescription copied from class:NestedServletExceptionReturn the detail message, including the message from the nested exception if there is one.- Overrides:
- getMessagein class- NestedServletException
 
- 
getHeaderNameReturn the expected name of the request header.
- 
getParameterReturn the method parameter bound to the request header.
 
-