Docs

Documentation versions (currently viewingVaadin 24)

Route Parameters

Learn how to use route parameters in a Vaadin application.

Route parameters are dynamic segments in a URL that allow extra information to be passed to a view. They are appended to the route path and can be used to personalize responses or modify application behavior.

For example, if an application has a greet route that accepts a string parameter, users can call it with URLs like:

  • /greet/John

  • /greet/Jane

  • /greet/World

Here, "John", "Jane", and "World" are parameter values that the greet route can use to generate a response.

Route Parameters vs Static Routes

Static routes always take precedence over dynamic ones. For instance, consider an application with both a customer route (which accepts a string parameter), and a customer/list route:

  • /customer/cu1234 → Calls the customer route with "cu1234" as the parameter value.

  • /customer/details → Calls the customer route with "details" as the parameter value.

  • /customer/list → Calls the dedicated customer/list route.

  • /customer → Returns a 404 Not Found error, unless the parameter is explicitly declared optional.

Using Route Parameters in Your Application

You can use route parameters in both Flow and Hilla views. The following guides show you how to implement them: