Annotation Type PathVariable

    • Optional Element Summary

      Optional Elements 
      Modifier and TypeOptional ElementDescription
      Stringname
      The name of the path variable to bind to.
      booleanrequired
      Whether the path variable is required.
      Stringvalue
      Alias for name().
      • name

        @AliasFor("value")
        String name
        The name of the path variable to bind to.
        Since:
        4.3.3
        Default:
        ""
      • required

        boolean required
        Whether the path variable is required.

        Defaults to true, leading to an exception being thrown if the path variable is missing in the incoming request. Switch this to false if you prefer a null or Java 8 java.util.Optional in this case. e.g. on a ModelAttribute method which serves for different requests.

        Since:
        4.3.3
        Default:
        true