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
    • MissingServletRequestParameterException

      @Deprecated(since="6.1", forRemoval=true) public MissingServletRequestParameterException(String parameterName, String parameterType, boolean missingAfterConversion)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructor for use when a value was present but converted to null.
      Parameters:
      parameterName - the name of the missing parameter
      parameterType - the expected type of the missing parameter
      missingAfterConversion - whether the value became null after conversion
      Since:
      5.3.6
  • 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

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