--- title: Embedding UIs in Web Pages order: 2 layout: page --- [[advanced.embedding]] = Embedding UIs in Web Pages Many web sites are not all Vaadin, but Vaadin UIs are used only for specific functionalities. In practice, many web applications are a mixture of dynamic web pages, such as JSP, and Vaadin UIs embedded in such pages. Embedding Vaadin UIs in web pages is easy and there are several different ways to embed them. One is to have a [literal]#++
++# placeholder for the UI and load the Vaadin Client-Side Engine with some simple JavaScript code. Another method is even easier, which is to simply use the [literal]#++ ---- The page will look as shown in <> below. [[figure.embedding.iframe]] .Vaadin Applications Embedded Inside IFrames image::img/embedding3.png[] You can embed almost anything in an iframe, which essentially acts as a browser window. However, this creates various problems. The iframe must have a fixed size, inheritance of CSS from the embedding page is not possible, and neither is interaction with JavaScript, which makes mashups impossible, and so on. Even bookmarking with URI fragments will not work. Note also that websites can forbid iframe embedding by specifying an [literal]#++X-Frame-Options: SAMEORIGIN++# header in the HTTP response. ifdef::web[] [[advanced.embedding.xs]] == Cross-Site Embedding with the Vaadin XS Add-on __The XS add-on is currently not available for Vaadin 7.__ In the previous sections, we described the two basic methods for embedding Vaadin applications: in a [literal]#++
++# element and in an [literal]#++