Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Embedding Vaadin application inside a div Element
hello,
i try to configure my vaadin app using div like it is described there:
https://vaadin.com/book/-/page/application.embedding.html#figure.embedding.div
i created now a demo test app to show you my problem
call vaadin test app:
then i follow the steps from vaadin tutorial
and thats the first approach
http://admin.c-berger.org:8888/Test/Login.html
WebConsole shows: wnd.vaadin is not defined
second approach
http://admin.c-berger.org:8888/Test/Login2.html
WebConsole shows: e is null
please help, i am little bit frustrated :(
thanks in advance for any information you can provide!
Kind regards from Austria,
Chris
It should work as described in the beginning of the section, but looks like the "complete example" at the end of the section is probably a bit outdated.
So, your second approach is more correct. I don't quite know what causes the problem.
Anyhow, here's an updated example of basic embedding.
Please note that the embedding div should be enclosed "<div id="foo"></div>", not self-enclosing "<div id="foo"/>".
hello,
thanks for feedback, that is working as you can see here:
http://admin.c-berger.org:8888/Test20120312/Login3.html
but know i have a little problem, dont know why this is working with iframe but now webconsole says:
[21:48:00.343] GET http://admin.c-berger.org:8888/Test/VAADIN/themes/reindeer/styles.css [HTTP/1.1 404 Not Found 109ms]
my styles.css in themes directory contains:
@import url(../reindeer/styles.css);
reindeer look is inside of vaadin jar
someone has an idea?
thanks, best regards Chris
hello again,
problem is located in web.xml
<servlet-mapping>
<servlet-name>Test Application</servlet-name>
<url-pattern>/App/*</url-pattern>
</servlet-mapping>
i need that to show the Login.html, but that leads to reindeer problem
default servlet mapping like:
<servlet-mapping>
<servlet-name>Test Application</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
then is reindeer working but i am not able to show a Login.html, because everything is routed to Test Application
i think thats easy for someone who has know-how with web.xml structure :)
thx, best regards Chris
For the theme problem, if your application servlet is mapped with /foo/*, you need to add an additional mapping /VAADIN/* to the same servlet (or any Vaadin servlet).
You could also have the Vaadin app in the normal /* mapping and serve static resources from a sub-url such as /static/* if you map the sub-url to the default servlet.
hello,
thank u very much, this helps as well :)
the next problem was that logoff leads not to Login.html but to Serlvet/App as it is configured in web.xml
that i was able to solve with this:
getMainWindow().getApplication().setLogoutURL("Login6.html");
i will wait a couple of time till closing this thread
maybe new things will poping up
thanks again for help
bye Chris