Logout to redirect to UI within root class


After reading the guide
i tried the following.


What it does is, it redirects to my vaadin root class, which also contains the login UI. The problem is it creates a new session and gets timeout.

What I wanted to do is to redirect back to my vaadin root. Is there any better way to achieve this without the timeout error?


My guess is that request.getContextPath() is just an empty string, with causes setLocation to just reload the page. You could instead test using “/” + request.getContextPath() which should properly redirect to the root of the web application context in all cases.


I see. Just to verify again. If it redirects to the root, which is also my vaadin root, it restarts my vaadin app with a new session too?

Yes, reopening a URL that loads a Vaadin UI after closing the session will cause a new session to be opened.

I need one help like this.
I want to load MainUI( extends UI) after Login success. Simply I want to load another UI. How to do this. Is it possible…?
Humbly requesting… pls…