What version are you using? HtmlImport is a legacy feature which does not do what you think it does.
Please take a look at the docs how to use lit templates Template-based Components | Templates | Creating UI | Flow | Vaadin Docs
for my vaadin_version is 24.4.10 (latest) and kotlin_version is 2.0.20
.
can you help me, please
Please take a look at the documentation linked above - those are for 24.4
P.S. Spring Boot 3.1 is too old für Vaadin 24.4
Please take a close look at the documentation. You are duplicating the /frontend/ path - it’s automatically added to the path.
The real error should be at the bottom
If drawing.html
is a static HTML file it should not go under frontend
folder, but in a place where it can be served by the servlet container, for example src/main/resources/META-INF/resources/
.
Take a look at the documentation for more information.
How does the IFrame source look like now?
If you put the static file in src/main/resources/META-INF/resources/frontend/drawing.html
, the source attribute should be /frontend/drawing.html
(given that you are on the root context-path)
initially, i tried to add vaadin plugin for frontend in build.gradle. and i have automatic frontend package on src/main
if i rename drawing.html to index.html which is in src/main/frontend/, it works but other admin.kt and main.kt files cannot be called.
It seems there might be some confusion about how Vaadin works, but I apologize in advance if I misunderstood your question.
When using Vaadin Flow, you are not supposed to create an HTML file for every view.
Usually, you’ll have an autogenerated index.html file that bootstrap the application in the browser, and then you navigate through views that you build in Java (or Kotlin in your case).
I would recommend checking out the tutorial and Building Apps The Vaadin Way, as they offer a great overview and might help clarify things.