Annotation Interface FormParam


@Retention(RUNTIME) @Target(PARAMETER) public @interface FormParam
Injects an individual form field or a complete form object into a handler method parameter.

The request must use application/x-www-form-urlencoded. Standard validation annotations may be declared directly on the injected parameter.

multipart/form-data requests can still be handled as raw request payloads, for example by declaring an unannotated byte[] or String parameter on a web handler method, but multipart parts are not exposed through @FormParam.

Examples:

@HandlePost("/newsletter")
void subscribe(@FormParam @NotBlank String email) { ... }

@HandlePost("/user")
UserId createUser(@FormParam UserForm form) { ... }
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Form parameter name.
  • Element Details

    • value

      String value
      Form parameter name. If left empty, it defaults to the method parameter's name;
      Default:
      ""