Package org.springframework.web.bind
Class MissingPathVariableException
java.lang.Object
java.lang.Throwable
java.lang.Exception
jakarta.servlet.ServletException
org.springframework.web.bind.ServletRequestBindingException
org.springframework.web.bind.MissingRequestValueException
org.springframework.web.bind.MissingPathVariableException
- All Implemented Interfaces:
- Serializable,- ErrorResponse
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.- Since:
- 4.2
- Author:
- Rossen Stoyanchev
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.springframework.web.ErrorResponseErrorResponse.Builder
- 
Constructor SummaryConstructorsConstructorDescriptionMissingPathVariableException(String variableName, MethodParameter parameter) Constructor for MissingPathVariableException.MissingPathVariableException(String variableName, MethodParameter parameter, boolean missingAfterConversion) Constructor for use when a value was present but converted tonull.
- 
Method SummaryModifier and TypeMethodDescriptionfinal MethodParameterReturn the method parameter bound to the path variable.Return the HTTP status code to use for the response.final StringReturn the expected name of the path variable.Methods inherited from class org.springframework.web.bind.MissingRequestValueExceptionisMissingAfterConversionMethods inherited from class org.springframework.web.bind.ServletRequestBindingExceptiongetBody, getDetailMessageArguments, getDetailMessageCodeMethods inherited from class jakarta.servlet.ServletExceptiongetRootCauseMethods inherited from class java.lang.ThrowableaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.web.ErrorResponsegetDetailMessageArguments, getHeaders, getTitleMessageCode, updateAndGetBody
- 
Constructor Details- 
MissingPathVariableExceptionConstructor for MissingPathVariableException.- Parameters:
- variableName- the name of the missing path variable
- parameter- the method parameter
 
- 
MissingPathVariableExceptionpublic MissingPathVariableException(String variableName, MethodParameter parameter, boolean missingAfterConversion) Constructor for use when a value was present but converted tonull.- Parameters:
- variableName- the name of the missing path variable
- parameter- the method parameter
- missingAfterConversion- whether the value became null after conversion
- Since:
- 5.3.6
 
 
- 
- 
Method Details- 
getMessage- Overrides:
- getMessagein class- Throwable
 
- 
getVariableNameReturn the expected name of the path variable.
- 
getParameterReturn the method parameter bound to the path variable.
- 
getStatusCodeDescription copied from interface:ErrorResponseReturn the HTTP status code to use for the response.- Specified by:
- getStatusCodein interface- ErrorResponse
- Overrides:
- getStatusCodein class- ServletRequestBindingException
 
 
-