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

public Class MissingServletRequestParameterException

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

ServletRequestBindingException subclass that indicates a missing parameter.
Author
Juergen Hoeller
Since
2.0.2

Field Summary

Modifier and TypeField and Description
private final MethodParameter
private final String
private final String

Constructor Summary

AccessConstructor and Description
public
MissingServletRequestParameterException(String
the name of the missing parameter
parameterName
,
String
the expected type of the missing parameter
parameterType
)

Constructor for MissingServletRequestParameterException.

public
MissingServletRequestParameterException(String
the name of the missing parameter
parameterName
,
MethodParameter
the target method parameter for the missing value
parameter
,
boolean
whether the value became null after conversion
missingAfterConversion
)

Constructor with a MethodParameter instead of a String parameterType.

public
MissingServletRequestParameterException(String
the name of the missing parameter
parameterName
,
String
the expected type of the missing parameter
parameterType
,
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 String
getMessage()

Overrides java.lang.Throwable.getMessage.

Returns the detail message string of this throwable.
public MethodParameter
getMethodParameter()

Return the target MethodParameter if the exception was raised for a controller method argument.

public final String
getParameterName()

Return the name of the offending parameter.

public final String
getParameterType()

Return the expected type of the offending parameter.

private static String
Inherited from org.springframework.web.bind.MissingRequestValueException:
isMissingAfterConversion

Field Detail

parameterback to summary
private final MethodParameter parameter
Annotations
@Nullable
parameterNameback to summary
private final String parameterName
parameterTypeback to summary
private final String parameterType

Constructor Detail

MissingServletRequestParameterExceptionback to summary
public MissingServletRequestParameterException(String parameterName, String parameterType)

Constructor for MissingServletRequestParameterException.

Parameters
parameterName:String

the name of the missing parameter

parameterType:String

the expected type of the missing parameter

MissingServletRequestParameterExceptionback to summary
public MissingServletRequestParameterException(String parameterName, MethodParameter parameter, boolean missingAfterConversion)

Constructor with a MethodParameter instead of a String parameterType.

Parameters
parameterName:String

the name of the missing parameter

parameter:MethodParameter

the target method parameter for the missing value

missingAfterConversion:boolean

whether the value became null after conversion

Since
6.1
MissingServletRequestParameterExceptionback to summary
public MissingServletRequestParameterException(String parameterName, String parameterType, boolean missingAfterConversion)

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

Parameters
parameterName:String

the name of the missing parameter

parameterType:String

the expected type of the missing parameter

missingAfterConversion:boolean

whether the value became null after conversion

Annotations
@Deprecated
since:6.1
forRemoval:true
Since
5.3.6

Method Detail

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
getMethodParameterback to summary
public MethodParameter getMethodParameter()

Return the target MethodParameter if the exception was raised for a controller method argument.

Annotations
@Nullable
Since
6.1
getParameterNameback to summary
public final String getParameterName()

Return the name of the offending parameter.

getParameterTypeback to summary
public final String getParameterType()

Return the expected type of the offending parameter.

initBodyDetailback to summary
private static String initBodyDetail(String name)