I am new to Vaadin and started recently with Vaadin+Spring.
I need several UIs to build a portal. So I have encounter the problem switching between them:
Given
Two UIs that implement ViewDisplay.
Views created and marked with @SpringView(name=“”, ui = FirstUI.class) annotation. Similarely for SecondUI.
FirstUI has @SpringUI(path=“/”) and SecondUI has @SpringUI(path=“/second”) paths.
FirstUI has a button and by clicking on it I want to redirect to SecondUI.
During dynamic registration of SpringViewDisplay beans they are added there as
SpringViewDisplayRegistrationBean.class . This means that first UI that you request will be registered as SpringViewDisplay bean and when if you request second UI it will be used as “display” for navigator.
#com.vaadin.spring.server.SpringUIProvider#configureNavigatorL272
Object springViewDisplay = findSpringViewDisplay(ui); <-- HERE firstly created UI will be returned
Do not know if it was done intentionally. Will post an issue to github.
I haven’t tried it myself and it might be that there is issues with the new SpringViewDisplay annotation in such a multi UI setup. Could you prepare a small example project what you are trying to approach and attach that to the
related github issue ? That would help to get the issue resolved sooner.
BTW. How are you composing your “portal”, are you sure you need multiple UIs? It might be that you’d be better of by having just one UI and multiple view/subviews. Most often you are better of with just one UI entry point.
Regarding my architecture, parts of my portal are like separate applications with different servlet paths. I think it would be easier to have UIs for them separately with their own navigators. Of course I can create totaly standalone applications for them to solve the issue with SpringViewDisplay but not sure that I need this right now. I am far away from production and this will be decided later. So far for me it’s easier to have everything in one place, of course, with future possibility to extract them to separate apps.