From 41aa59d17d8f88ef0a0571298692a0430d5b9a90 Mon Sep 17 00:00:00 2001 From: Mirco Date: Thu, 5 Sep 2024 15:33:47 +0200 Subject: [PATCH] Fix exception "new request handling", tie beans to the lifecycle of Vaadin Flow routing components; PreserveOnRefresh is not necessaary --- src/main/java/com/ModeratorElection/MainView.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/ModeratorElection/MainView.java b/src/main/java/com/ModeratorElection/MainView.java index d417b06..15e69ca 100644 --- a/src/main/java/com/ModeratorElection/MainView.java +++ b/src/main/java/com/ModeratorElection/MainView.java @@ -12,9 +12,9 @@ import com.vaadin.flow.component.notification.Notification; import com.vaadin.flow.component.notification.NotificationVariant; import com.vaadin.flow.component.orderedlayout.HorizontalLayout; import com.vaadin.flow.component.orderedlayout.VerticalLayout; -import com.vaadin.flow.router.PreserveOnRefresh; import com.vaadin.flow.router.Route; import com.vaadin.flow.router.PageTitle; +import com.vaadin.flow.spring.annotation.RouteScope; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; @@ -22,9 +22,9 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -@Route("/") +@Route("") @PageTitle("Moderatorenwahl") -@PreserveOnRefresh +@RouteScope @Configuration public class MainView extends VerticalLayout {