Annotation Type Route

    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      boolean absolute
      Ignore route prefixes from parent layouts and only use the path defined in this annotation.
      Class<? extends RouterLayout> layout
      Sets the parent component for the route target component.
      boolean registerAtStartup
      Marks if this Route should be registered during the initial route registration on servlet startup.
      String value
      Sets the route template suffix value of the annotated class.
    • Field Detail

      • NAMING_CONVENTION

        static final String NAMING_CONVENTION
    • Element Detail

      • value

        String value
        Sets the route template suffix value of the annotated class.

        If no value is provided, the path will be derived from the class name of the component. The derived name will be in lower case and trailing "View" will be removed. Also, MainView or Main names will be mapped to root (value will be "").

        This value accepts also parameter template segments which can be defined using following format: :parameterName[?|*][(regex)].

        Note for framework developers: do not use the value directly, but use the helper method RouteUtil.resolve(Class, Route), so that naming convention based values are dealt correctly.

        Returns:
        the explicit path value of this route
        Default:
        "___NAMING_CONVENTION___"
      • layout

        Class<? extends RouterLayout> layout
        Sets the parent component for the route target component.

        When navigating between components that use the same layout, the same component instance is reused. Default layout target is the UI, but the layout should not be a custom UI as UI is a special class used to know where the route stack ends and no parent layouts should be involved.

        All layout stacks will be appended to the UI as it represents the Body element.

        Returns:
        the layout component class used by the route target component.
        See Also:
        RouterLayout
        Default:
        com.vaadin.flow.component.UI.class
      • absolute

        boolean absolute
        Ignore route prefixes from parent layouts and only use the path defined in this annotation.
        Returns:
        true to ignore parent layout prefixes, false otherwise
        Default:
        false
      • registerAtStartup

        boolean registerAtStartup
        Marks if this Route should be registered during the initial route registration on servlet startup.

        Default is to register route at startup.

        Returns:
        setting to false skips automatic registration
        Default:
        true