I’m pretty new to server side development. Vaadin’s functionality is really attractive and I’m doing a test with embedding vaadin application into a webpage.
This is what I did:
Create a new vaadin project inside eclipse
On the project tree in eclipse, right click “Run on Server”
The application is opened in a browser window.
Copy the webpage source code and create a index.html file
Add a
HELLO WORLD!
to the webpage.
Place the index.html file in the “Web Content” folder
Right click “Run on Server” and restart the server
The problem is that the generated contents does not change, still the welcome page generated from servlet.
What should I do to launch my index.html?
Hi, your problem is that Vaadin generates the index page in server side and does not use index pages from webcontent folder. In Book of Vaadin there is a chapter about embedding Vaadin application to html page:
If a Vaadin servlet is mapped to a sub-url, you always need to map the /VAADIN/* to the servlet as well (just once is enough if you have multiple servlets).
Thanks, but CUSTOM LAYOUT is a kind of template based solution, which is not what I want for the moment. I want the servlet to be embedded into a existing static page.
Thanks so much! Finally I figured out, that I have to change the web.xml as below and put myindex.html into the root “/*” folder, then everything works coorectly now.