Annotation Interface RouteCondition


@Target(METHOD) @Retention(RUNTIME) public @interface RouteCondition
Allows defining a condition for this route to match using an expression.

Within the scope of the expression a request variable is available that references the HttpRequest.

When added to a method the condition will be evaluated during route matching and if the condition does not evaluate to true the route will not be matched resulting in a HttpStatus.NOT_FOUND response.

Note that this annotation only applies to the server and is ignored when placed on declarative HTTP client routes.

Since:
4.0.0
See Also:
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    An expression that evalutes to true or false.
  • Element Details

    • value

      String value
      An expression that evalutes to true or false.
      Returns:
      The expression
      Since:
      4.0.0