Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Get current URL
My Current URL is http://localhost:8080/Test/?City=Sample
public class MyApplication extends Application {
private static final long serialVersionUID = 1L;
@Override
public void init() {
String url = getURL().toString();
System.out.println("url - > "+url);
}
}
Here I got http://localhost:8080/Test
but I wants http://localhost:8080/Test/Apps/?City=Sample
How it possible. Please help me.
Look at the JavaDocs when in doubt: Application.getURL. It returns the URL where the Application instance is located, not the URL the user entered into the browser.
A simple Google search for "vaadin query parameters" pointed to the appropriate section in the Book of Vaadin:
https://vaadin.com/book/-/page/advanced.resources.html
See if section 11.5.2 helps. Note that init() is not where you want this. The params could be different for every request that comes in from a client.
Cheers,
Bobby
Fist I load index.html, and click submit button from this page.
this action redirects our vaadin application http://localhost:8080/Test with the name of city 'Sample' (ie, http://localhost:8080/Test/Apps/?City=Sample)
The 'Sample' is the input of our my vaadin application. can I get Sample From that url
Answering my own message....
Bobby Bissett:
Arun R T: Fist I load index.html, and click submit button from this page.
this action redirects our vaadin application http://localhost:8080/Test with the name of city 'Sample' (ie, http://localhost:8080/Test/Apps/?City=Sample)
The 'Sample' is the input of our my vaadin application. can I get Sample From that urlYes, I think you can. That's why I pointed you to the section of the Book of Vaadin that tells you how. Did you try doing what it says?
I just tried it for the first time, and it works fine. See section 11.5.2 as I suggested: you just add a handler class that implements one method, and that method is called with a map of all your query params/values.
Good luck,
Bobby