Annotation Interface HandleWeb


Marks a method or meta-annotation as a handler for incoming web requests (MessageType.WEBREQUEST).

Web requests received by the Fluxzero Runtime are logged. Connected client applications can route these requests using this annotation or one of its specific variants, like HandleGet, HandlePost, etc.

This annotation can be used directly to handle any method (GET, POST, etc.), or indirectly via more specific annotations like HandleGet, HandlePost, HandleSocketOpen, etc.

By default, a handler will return a result which is published to the WebResponse log. To suppress this behavior, set passive = true.

See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    If true, HEAD requests may be routed to matching GET handlers when no explicit HEAD handler is present.
    boolean
    If true, matching routes may contribute to automatically generated OPTIONS responses when no explicit OPTIONS handler is present.
    boolean
    If true, disables this handler during discovery.
    HTTP or WebSocket methods that this handler supports (e.g.
    boolean
    If true, the handler will not publish a response to the WebResponse log.
    boolean
    If true, indexed web request messages whose effective timeout has already expired may be skipped before this handler is invoked.
    One or more path patterns this handler applies to (e.g.
  • Element Details

    • value

      String[] value
      One or more path patterns this handler applies to (e.g. /users, /accounts/{id}, /accounts/*/users). If empty, the path is based on the Path annotation.

      Patterns support literal path parts, {name} parameters, {name:regex} constrained parameters, and * wildcards. A non-final * matches within a single path segment, while a final * matches the rest of the path. Optional path fragments can be declared with square brackets, for example /users[/{id}]. Trailing slashes on non-root paths are ignored.

      Default:
      {}
    • disabled

      boolean disabled
      If true, disables this handler during discovery.
      Default:
      false
    • method

      String[] method
      HTTP or WebSocket methods that this handler supports (e.g. GET, POST, WS_OPEN). Default is HttpRequestMethod.ANY.
      Default:
      {"*"}
    • passive

      boolean passive
      If true, the handler will not publish a response to the WebResponse log.
      Default:
      false
    • skipExpiredRequests

      boolean skipExpiredRequests
      If true, indexed web request messages whose effective timeout has already expired may be skipped before this handler is invoked.

      Defaults to true for HTTP handlers because stale responses are usually no longer useful. WebSocket lifecycle annotations opt out because those messages represent connection events rather than ordinary requests.

      Default:
      true
    • autoHead

      boolean autoHead
      If true, HEAD requests may be routed to matching GET handlers when no explicit HEAD handler is present. Only applies to GET mappings.
      Default:
      true
    • autoOptions

      boolean autoOptions
      If true, matching routes may contribute to automatically generated OPTIONS responses when no explicit OPTIONS handler is present.
      Default:
      true