Fix exception "new request handling", tie beans to the lifecycle of Vaadin Flow routing components; PreserveOnRefresh is not necessaary

This commit is contained in:
Mirco 2024-09-05 15:33:47 +02:00
parent 8ce25820e8
commit 41aa59d17d

View file

@ -12,9 +12,9 @@ import com.vaadin.flow.component.notification.Notification;
import com.vaadin.flow.component.notification.NotificationVariant; import com.vaadin.flow.component.notification.NotificationVariant;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout; import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
import com.vaadin.flow.component.orderedlayout.VerticalLayout; import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.PreserveOnRefresh;
import com.vaadin.flow.router.Route; import com.vaadin.flow.router.Route;
import com.vaadin.flow.router.PageTitle; import com.vaadin.flow.router.PageTitle;
import com.vaadin.flow.spring.annotation.RouteScope;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
@ -22,9 +22,9 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@Route("/") @Route("")
@PageTitle("Moderatorenwahl") @PageTitle("Moderatorenwahl")
@PreserveOnRefresh @RouteScope
@Configuration @Configuration
public class MainView extends VerticalLayout { public class MainView extends VerticalLayout {