Annotation Type RequestParam
Binds a request parameter to this parameter: the query string's value, or,
when the query has none, a field of the form the body carries --
application/x-www-form-urlencoded, or a multipart/form-data part that is
not a file. That is what a servlet container and Spring read, and what an HTML
form posts. A file part is bound with RequestPart.
A missing value binds to the default below, or to null when the parameter is
not required. It is never a server error unless required says so.
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionUsed when the request omits it.booleanWhether a request without it is rejected.
-
Element Details
-
value
String valueThe name to bind from. REQUIRED, and deliberately so: it cannot default to the parameter's own name because a Java parameter name only survives compilation when the application is built with -parameters, which is the application's build to decide and not this one's. An annotation that promised the default would compile fine and then fail at packaging, for every developer who took it at its word. -
required
boolean requiredWhether a request without it is rejected.- Default:
true
-
defaultValue
-