注释类型 PathVariable

    • 可选元素概要

      可选元素 
      修饰符和类型可选元素说明
      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.
        从以下版本开始:
        4.3.3
        默认值:
        ""
      • 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.

        从以下版本开始:
        4.3.3
        默认值:
        true