Search code examples
javaurivaadinnavigator

How to manage uri in Vaadin with the Navigator


Vaadin provide a Navigator to navigate between pages, but I don't like the way it writes the url, for example /VaadinApp/#!login. How can I change that URI to /VaadinApp/login. Have anyone tried to do that ?


Solution

  • You need extend UriFragmentManager and override getState() and setState() methods:

    public void setState(String state)  {
       setFragment(state);
    }
    
    public String getState() {
       return getFragment() != null ? getFragment() : "";
    }