Package org.springframework.web.bind
Class MissingPathVariableException
- java.lang.Object
- java.lang.Throwable
- java.lang.Exception
- javax.servlet.ServletException
- org.springframework.web.util.NestedServletException
- org.springframework.web.bind.ServletRequestBindingException
- org.springframework.web.bind.MissingPathVariableException
- All Implemented Interfaces:
Serializable
public class MissingPathVariableException extends ServletRequestBindingException
ServletRequestBindingExceptionsubclass that indicates that a path variable expected in the method parameters of an@RequestMappingmethod 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:
- Serialized Form
Constructor Summary
Constructors Constructor Description MissingPathVariableException(String variableName, MethodParameter parameter)Constructor for MissingPathVariableException.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetMessage()Return the detail message, including the message from the nested exception if there is one.MethodParametergetParameter()Return the method parameter bound to the path variable.StringgetVariableName()Return the expected name of the path variable.Methods inherited from class javax.servlet.ServletException
getRootCause
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Constructor Detail
MissingPathVariableException
public MissingPathVariableException(String variableName, MethodParameter parameter)
Constructor for MissingPathVariableException.- Parameters:
variableName- the name of the missing path variableparameter- the method parameter
Method Detail
getMessage
public String getMessage()
Description copied from class:NestedServletExceptionReturn the detail message, including the message from the nested exception if there is one.- Overrides:
getMessagein classNestedServletException
getVariableName
public final String getVariableName()
Return the expected name of the path variable.
getParameter
public final MethodParameter getParameter()
Return the method parameter bound to the path variable.