Vaadin 7 Navigator Params from URL does not show up.

Hi,
I have build a simple Vaadin Application, from examples of the book. But i cant get it to work.

I have a Navigator on which i add one default view:

navigator = new Navigator(this, verticalLayot); // in my UI Class navigator.addView("",new TextView("Sample Text")); When i know open my Browser and Test this with http://localhost:8080/SampleView
The View appears and all seams alright.

Then i added a ViewChangeListener:

[code]
navigator.addViewChangeListener(new ViewChangeListener(){

        @Override
        public boolean beforeViewChange(ViewChangeEvent event) {
            System.out.println("Viewname:"+event.getViewName() + "Params:"+event.getParameters());
            System.out.println("Navigationstate:"+navigator.getState());
            return true;
        }
        @Override
        public void afterViewChange(ViewChangeEvent event) {

        }
        
    });

[/code]And i run this URL on the Page: http://localhost:8080/SampleView/Test/Bla/Foo/Bar

My Expectation was some information in the even.getParams(); But there is nothing: This is my output:

Viewname:Params: Navigationstate: Viewname is blank, thats good. But Params, should there not be something or did i misunderstood the params, because i wanted the information from the URL.

Thanks alot for any help.

greetings Michael

Hello Michael,

Properly using “regular” URL paths like “/SampleView/Test/Bla/Foo/Bar” in a single-page AJAX application requires that the browser implement the
HTML5 history API
, and not all browsers supported by Vaadin do at the moment. Hence, Vaadin uses so-called
“hashbang” URLs
, utilizing the “hash” fragment which traditionally is the only thing in the location URL that can be manipulated from JavaScript without causing a browser page refresh. Try navigating to

http://localhost:8080/#!/SampleView/Test/Bla/Foo/Bar

and you should see the default view with params “SampleView/Test/Bla/Foo/Bar”. Note that the following

http://localhost:8080/#!SampleView/Test/Bla/Foo/Bar

without the slash would instead try to navigate to the non-existing view “SampleView” with params “Test/Bla/Foo/Bar”.

Wah, thanks alot.
I am sure i read this, but i however forget or didn’t get it right.

Thanks!