Annotation Interface Default
Specifies the default value of an optional parameter.
-
Optional Element Summary
-
Element Details
-
value
String valueThe default value to use as a fallback when the request parameter is not provided or has an empty value. WhenDefault
annotation exists butvalue()
is not specified,null
value would be set if the parameter is not present in the request.When
Default
annotation exists andvalue()
is not specified, the parameter may be present in the request without a value (e.g./foo?bar=
). In this case, the behavior depends on the java type with which the parameter will be bound to.Actions Type Action Primitive types An IllegalArgumentException
will be thrownString
An empty string ""
will be setList
orSet
An empty collection will be set Other The null
value will be setDefault
annotation is not allowed for a path variable. If a user usesDefault
annotation on a path variable,IllegalArgumentException
would be raised.- Default:
"\n\t\t\n\t\t\n\u0000\u0001\u0002\n\t\t\t\t\n"
-