Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.
@Retention(CLASS) @Target({PARAMETER})
public @interface 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.
Methods
public abstract String value() | The name to bind from. |
public abstract boolean required() default true | Whether a request without it is rejected. |
public abstract String defaultValue() default "" | Used when the request omits it. |
Method details
value
public abstract String value()The 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
public abstract boolean required() default trueWhether a request without it is rejected.
defaultValue
public abstract String defaultValue() default ""Used when the request omits it.