Getting Registered Routes

To retrieve all registered Routes, use:

List<RouteData> routes = RouteConfiguration.forSessionScope().getAvailableRoutes();
  • The RouteData object contains all the relevant information about the defined route, such as the route template, parameters, and parent layouts.

Getting Registered Routes by Parent Layout

To retrieve all the routes defined by parent layout, use:

List<RouteData> routes = RouteConfiguration.forSessionScope().getAvailableRoutes();
List<RouteData> myRoutes =routes.stream()
        .filter(routeData -> MyParentLayout.class.equals((routeData.getParentLayout())))
        .collect(Collectors.toList());