Annotation Interface RequestHeader


@Documented @Target(PARAMETER) @Retention(RUNTIME) public @interface RequestHeader
Retrieves one header entry from the associated http request and passes it to the annotated method parameter. This annotation can be combined with @Optional to mark the header as optional.
Since:
4.0
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Get the key of the header to retrieve from the associated http request.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Gets the default value to inject if no header with the specified key is given and the parameter marked as optional.
  • Element Details

    • value

      Get the key of the header to retrieve from the associated http request.
      Returns:
      the key of the header.
    • def

      Gets the default value to inject if no header with the specified key is given and the parameter marked as optional. This defaults to __NULL__ which will inject null for the parameter.
      Returns:
      the default value to inject if this header is not present.
      Default:
      "__NULL__"