Class MissingServletRequestParameterException

All Implemented Interfaces:
Serializable, ErrorResponse

public class MissingServletRequestParameterException extends MissingRequestValueException
ServletRequestBindingException subclass that indicates a missing parameter.
Since:
2.0.2
Author:
Juergen Hoeller
See Also:
  • Constructor Details

    • MissingServletRequestParameterException

      public MissingServletRequestParameterException(String parameterName, String parameterType)
      Constructor for MissingServletRequestParameterException.
      Parameters:
      parameterName - the name of the missing parameter
      parameterType - the expected type of the missing parameter
    • MissingServletRequestParameterException

      public MissingServletRequestParameterException(String parameterName, MethodParameter parameter, boolean missingAfterConversion)
      Constructor with a MethodParameter instead of a String parameterType.
      Parameters:
      parameterName - the name of the missing parameter
      parameter - the target method parameter for the missing value
      missingAfterConversion - whether the value became null after conversion
      Since:
      6.1
  • Method Details

    • getMessage

      public String getMessage()
      Overrides:
      getMessage in class Throwable
    • getParameterName

      public final String getParameterName()
      Return the name of the offending parameter.
    • getParameterType

      public final String getParameterType()
      Return the expected type of the offending parameter.
    • getMethodParameter

      public @Nullable MethodParameter getMethodParameter()
      Return the target MethodParameter if the exception was raised for a controller method argument.
      Since:
      6.1