Deafult Screen not opening after login

Hi,

Jmix 2.0
I had added below parameter in my application.properties file but still blank page or last session page is displayed instead of default page mention in the properties files.
`jmix.ui.default-view-id=LeadDashboardView

@Route(value = “lead-dashboard-view”, layout = MainView.class)
@ViewController(“LeadDashboardView”)
@ViewDescriptor(“lead-dashboard-view.xml”)`

Hello, try with this.

  • remove or comment out your parameter
  • edit your MainView.java and add this code
    //default view
    @Override
    public void beforeEnter(BeforeEnterEvent event) {
        // Check if the root path is accessed
        if (event.getLocation().getPath().isEmpty()) {
            // Redirect to the view route when accessing the root path
            event.forwardTo(LeadDashboardView.class);
        }
    }

Kind regards,
Mladen

1 Like

@Route("")
@ViewController(“MainView”)
@ViewDescriptor(“main-view.xml”)
public class MainView extends StandardMainView {

}

getting

DevelopmentException: Target view.main.MainView does not support event type class com.vaadin.flow.router.BeforeEnterEvent

Hi,

Thank you solution works i had added @subscribe instead of @override due to this it was not working previously. Now working with @override.

1 Like