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

public Class MissingPathVariableException

extends MissingRequestValueException
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
org.springframework.core.MethodParameter, org.springframework.http.HttpStatus, .HttpStatusCode

ServletRequestBindingException subclass that indicates that a path variable expected in the method parameters of an @RequestMapping method is not present among the URI variables extracted from the URL. Typically that means the URI template does not match the path variable name declared on the method parameter.
Author
Rossen Stoyanchev
Since
4.2
See Also
MissingMatrixVariableException

Field Summary

Modifier and TypeField and Description
private final MethodParameter
private final String

Constructor Summary

AccessConstructor and Description
public
MissingPathVariableException(String
the name of the missing path variable
variableName
,
MethodParameter
the method parameter
parameter
)

Constructor for MissingPathVariableException.

public
MissingPathVariableException(String
the name of the missing path variable
variableName
,
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 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 path variable.

public HttpStatusCode
public final String
getVariableName()

Return the expected name of the path variable.

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

Field Detail

parameterback to summary
private final MethodParameter parameter
variableNameback to summary
private final String variableName

Constructor Detail

MissingPathVariableExceptionback to summary
public MissingPathVariableException(String variableName, MethodParameter parameter)

Constructor for MissingPathVariableException.

Parameters
variableName:String

the name of the missing path variable

parameter:MethodParameter

the method parameter

MissingPathVariableExceptionback to summary
public MissingPathVariableException(String variableName, MethodParameter parameter, boolean missingAfterConversion)

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

Parameters
variableName:String

the name of the missing path variable

parameter:MethodParameter

the method parameter

missingAfterConversion:boolean

whether the value became null after conversion

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
getParameterback to summary
public final MethodParameter getParameter()

Return the method parameter bound to the path variable.

getStatusCodeback to summary
public HttpStatusCode getStatusCode()

Overrides org.springframework.web.bind.ServletRequestBindingException.getStatusCode.

Implements org.springframework.web.ErrorResponse.getStatusCode.

Doc from org.springframework.web.ErrorResponse.getStatusCode.

Return the HTTP status code to use for the response.

Annotations
@Override
getVariableNameback to summary
public final String getVariableName()

Return the expected name of the path variable.