Using root URL for Vaadin app
Last updated
Was this helpful?
Last updated
Was this helpful?
Example code is available on .
URL mapping can be done also in way we use /
root URL to display Vaadin application. In this article, we are going to show how to do it.
Create mapping in UrlMapping.groovy
as follows:
Then we need to create the controller that will redirect the request to the Vaadin application.
Last step is to make sure that VaadinConfig.groovy contains mapping to Vaadin UI class.
Create a controller and implement some logic there. For example, fetch some data from database and return it as JSON.
Create two sample Vaadin UI, so we can verify URL mapping.
Start up the application and try out these URLs:
redirects user to application
displays JSON response