0

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 (https://vaadin.com/docs/v23/configuration/properties) , 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

4
  • 1
    What does the console- and the network-tab tell in the browser? Was a proper clean exercised when building with the new version? Commented Mar 18 at 10:06
  • 1
    The first thing I would change is to not use /vaadin/ as /VAADIN/ is used for a lot of internal URLs and some servers might mix them Commented Mar 18 at 11:57
  • Colleagues from vaadin suggested the reason on the forum vaadin.com/forum/t/blank-index-html-page-when-routing-any-url/… Commented Mar 25 at 8:58
  • 1
    If the answers in the linked Forum helped, you should yourself formulate answer to your own question so that this one is not left hanging here. That is recommend practice at StackOverflow. It will help the other users who may find this question by search. Commented Apr 24 at 9:04

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.