Package org.springframework.web.bind

# Class MissingRequestValueException

java.lang.Object
java.lang.Throwable
java.lang.Exception
jakarta.servlet.ServletException
org.springframework.web.bind.ServletRequestBindingException
org.springframework.web.bind.MissingRequestValueException

All Implemented Interfaces:
  `Serializable`, `ErrorResponse`

Direct Known Subclasses:
  `MissingMatrixVariableException`, `MissingPathVariableException`, `MissingRequestCookieException`, `MissingRequestHeaderException`, `MissingServletRequestParameterException`

public class MissingRequestValueException extends ServletRequestBindingException
Base class for `ServletRequestBindingException` exceptions that could not bind because the request value is required but is either missing or otherwise resolves to `null` after conversion.

Since:
  5.3.6
Author:
  Rossen Stoyanchev
See Also:
  - Serialized Form

## Nested Class Summary

## Nested classes/interfaces inherited from interface org.springframework.web.ErrorResponse

`ErrorResponse.Builder, ErrorResponse.Interceptor`

## Constructor Summary

Constructors
Modifier
Constructor
Description
``
`MissingRequestValueException(String msg)`
Constructor with a message only.
``
`MissingRequestValueException(String msg, boolean missingAfterConversion)`
Constructor with a message and a flag that indicates whether a value was present but became `null` after conversion.
`protected`
`MissingRequestValueException(String msg, boolean missingAfterConversion, String messageDetailCode, Object[] messageDetailArguments)`
Constructor with a given `ProblemDetail`, and a `MessageSource` code and arguments to resolve the detail message with.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`isMissingAfterConversion()`
Whether the request value was present but converted to `null`, for example, via `org.springframework.core.convert.support.IdToEntityConverter`.

### Methods inherited from class org.springframework.web.bind.ServletRequestBindingException

`getBody, getDetailMessageArguments, getDetailMessageCode, getStatusCode`

### Methods inherited from class jakarta.servlet.ServletException

`getRootCause`

### Methods inherited from class java.lang.Throwable

`addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.springframework.web.ErrorResponse

`getDetailMessageArguments, getHeaders, getTitleMessageCode, getTypeMessageCode, updateAndGetBody`

## Constructor Details

### MissingRequestValueException

public MissingRequestValueException(String msg)
Constructor with a message only.

### MissingRequestValueException

public MissingRequestValueException(String msg, boolean missingAfterConversion)
Constructor with a message and a flag that indicates whether a value was present but became `null` after conversion.

### MissingRequestValueException

protected MissingRequestValueException(String msg, boolean missingAfterConversion, @Nullable String messageDetailCode, @Nullable Object[] messageDetailArguments)
Constructor with a given `ProblemDetail`, and a `MessageSource` code and arguments to resolve the detail message with.

Since:
  6.0

## Method Details

### isMissingAfterConversion

public boolean isMissingAfterConversion()
Whether the request value was present but converted to `null`, for example, via `org.springframework.core.convert.support.IdToEntityConverter`.