admin管理员组

文章数量:1386656

I am trying to run a page using Vaadin 23, but I get index.html on any url My project uses:

  • java version=17
  • spring-mvc version=5.3.20
  • apache tomcat version=8.5.85

But as a dependency manager on the project we use ivy and ant (this is a legacy project) I added settings for VaadinServlet in web.xml similar to the documentation () , and also defined VaadinApplicationConfiguration as a spring bean

    <context:annotation-config/>
    <bean class="com.vaadin.flow.spring.VaadinApplicationConfiguration"/>

My project compiles successfully and I do not see any errors related to Vaadin in the logs. I added a simple test page on Vaadin

@Route("vaadin/test")
public class TestView extends HorizontalLayout {
    private TextField name;
    private Button sayHello;
    public TestView() {
        name = new TextField("Your name");
        sayHello = new Button("Say hello");
        sayHello.addClickListener(e -> Notification.show("Hello " + name.getValue()));
        sayHello.addClickShortcut(Key.ENTER);
        setMargin(true);
        setVerticalComponentAlignment(Alignment.END, name, sayHello);
        add(name, sayHello);
    }
}

when I go to the URL /vaadin/test, I get an empty index.html page from the META-INF/VAADIN/webapp directory When I go to any other URL, I also get an empty index.html page

I expect that when going to the URL vaadin/test my page will open, and not an empty index.html

本文标签: springVaadin 23Blank indexhtml page when routing any URLStack Overflow