I have a need to display static html and css in a view WITHOUT using iframes. Any suggestions? This will be a landing page for an app, I’d like it to be fairly efficient loading over many times.
Thanks so much!
Regards,
Clint
I have a need to display static html and css in a view WITHOUT using iframes. Any suggestions? This will be a landing page for an app, I’d like it to be fairly efficient loading over many times.
Thanks so much!
Regards,
Clint
Use a reverse proxy and/or CDN in front of your application and serves the static content from there. You also have additional benefits that your application server is not directly exposed to the web.
Did you consider the built-in Html
component?
You also could create a Div and set static html content as innerHtml.
div.getElement().setProperty("innerHTML", "<b>Hello</b>");
But I think this would result in the same as using the Html
component.
As you can infer from the above answers, you can either show plain HTML (as per what @knoobie suggested), or display the HTML content inside your Flow application. From a performance point of view, the former is usually better, but it requires a more complicated environment set-up. Whether this tradeoff is worth the effort depends on the details of your app (do you need to have the HTML content to be inside your Vaadin app, e.g. with the navigation bar loaded already, etc.). A secret third option would be to embed your Vaadin application inside your HTML page and only loaded dynamically when needed, but this approach isn’t particularly easy to implement and comes with its own limitations.