Datta Dhonde
Datta Dhonde

Reputation: 193

How to retrieve URL from browse in Vaadin

I want to store URL of from browser in a Java String. Below is my code URL which opens up UI for creating password.

http://localhost:8080/createpassword?userId=1

I'm using Vaadin 23

Upvotes: 1

Views: 133

Answers (1)

Simon Martinelli
Simon Martinelli

Reputation: 36143

UI.getCurrent().getPage().fetchCurrentURL(currentUrl -> {
    // This is your own method that you may do something with the url.
    // Please note that this method runs asynchronously
    storeCurrentURL(currentUrl);
});

Read more: https://vaadin.com/docs/latest/advanced/browser-access

Upvotes: 5

Related Questions