spring-framework / org.springframework.web.bind.annotation / RequestAttribute / required

required

val required: Boolean

Whether the request attribute is required.

Defaults to true, leading to an exception being thrown if the attribute is missing. Switch this to false if you prefer a null or Java 8 java.util.Optional if the attribute doesn't exist.