Get current URL

My Current URL is http://localhost:8080/Test/?City=Sample

public class MyApplication extends Application {

	private static final long serialVersionUID = 1L;

	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:
. 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:

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.


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…

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,