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.
Vaadin 8 display custom page, when user hits back button.
Hi all,
when user clicks on back button in browser, he`s redirected to previous page in vaadin (if any, i`m using Vaadins Navigator and Spring-vaadin plugin with SpringViewProvider).
Is there a possibility to implement something like a redirector to an error page or page expired ?
Thanks.
You could implement an NavigationStateManager and add it to your Navigator class (via constructor).
In Vaadin 7.x a Navigator.UriFragmentManager (default implementation of NavigationStateManager) contained a method uriFragmentChanged(UriFragmentChangedEvent event), which could be overwritten.
In Vaadin 8.x you have to copy the implementation of Navigator.UriFragmentManager to your own implementation class in order to add an custom UriFragmentChangedListener (Deprecated). Java Doc directs to com.vaadin.server.Page.PopStateListener which should be used instead (I haven't tested this yet).
UPDATE: PopStateListener works and is the preferred way