Top Description Fields Constructors Methods
org.springframework.web.bind

public Class MissingRequestHeaderException

extends MissingRequestValueException
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
org.springframework.core.MethodParameter

ServletRequestBindingException subclass that indicates that a request header expected in the method parameters of an @RequestMapping method is not present.
Author
Juergen Hoeller
Since
5.1
See Also
MissingRequestCookieException

Field Summary

Modifier and TypeField and Description
private final String
private final MethodParameter

Constructor Summary

AccessConstructor and Description
public
MissingRequestHeaderException(String
the name of the missing request header
headerName
,
MethodParameter
the method parameter
parameter
)

Constructor for MissingRequestHeaderException.

public
MissingRequestHeaderException(String
the name of the missing request header
headerName
,
MethodParameter
the method parameter
parameter
,
boolean
whether the value became null after conversion
missingAfterConversion
)

Constructor for use when a value was present but converted to null.

Method Summary

Modifier and TypeMethod and Description
public final String
getHeaderName()

Return the expected name of the request header.

public String
getMessage()

Overrides java.lang.Throwable.getMessage.

Returns the detail message string of this throwable.

public final MethodParameter
getParameter()

Return the method parameter bound to the request header.

Inherited from org.springframework.web.bind.MissingRequestValueException:
isMissingAfterConversion

Field Detail

headerNameback to summary
private final String headerName
parameterback to summary
private final MethodParameter parameter

Constructor Detail

MissingRequestHeaderExceptionback to summary
public MissingRequestHeaderException(String headerName, MethodParameter parameter)

Constructor for MissingRequestHeaderException.

Parameters
headerName:String

the name of the missing request header

parameter:MethodParameter

the method parameter

MissingRequestHeaderExceptionback to summary
public MissingRequestHeaderException(String headerName, MethodParameter parameter, boolean missingAfterConversion)

Constructor for use when a value was present but converted to null.

Parameters
headerName:String

the name of the missing request header

parameter:MethodParameter

the method parameter

missingAfterConversion:boolean

whether the value became null after conversion

Since
5.3.6

Method Detail

getHeaderNameback to summary
public final String getHeaderName()

Return the expected name of the request header.

getMessageback to summary
public String getMessage()

Overrides java.lang.Throwable.getMessage.

Doc from java.lang.Throwable.getMessage.

Returns the detail message string of this throwable.

Returns:String

the detail message string of this Throwable instance (which may be null).

Annotations
@Override
getParameterback to summary
public final MethodParameter getParameter()

Return the method parameter bound to the request header.