Cosmin Baciu
Cosmin Baciu

Reputation: 43

Vaadin MainView

I have a classic springboot application which is REST based. I want to start working with Vaadin in order to create ui components directly from java code.

I found in their tutorial that you have to create a MainView class with a @Route(''), but, after created it, it gives me 404 when i want to acces that route.

package com.salesmanager.shop.ui;


import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.notification.Notification;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.Route;

@Route("/vaadin")
public class MainView extends VerticalLayout {

    public MainView() {
        Button button = new Button("Click me",
                event -> Notification.show("Clicked!"));
        add(button);
    }
}

Do you know if i have to modify other files or something?

Thank you!

Upvotes: 1

Views: 265

Answers (1)

Alim Özdemir
Alim Özdemir

Reputation: 2634

Just remove the slash:

@Route("vaadin")

Upvotes: 2

Related Questions