~~NOTRANS~~ ==== CORS ==== All details about [[http://en.wikipedia.org/wiki/Cross-origin_resource_sharing|cross-origin resource sharing]]. ==== Use-Case ==== Embedding a Vaadin application in your CMS (e.g., Joomla, Typo3). The CMS runs in an hosted environment without Java application server (standard and cheap web hosting). ==== How To ==== There's an excellent [[https://vaadin.com/blog/-/blogs/using-cors-with-vaadin|blog post from Vaadin]]. We have a ready-to-use solution added to our Vaadin UI. It's really simple to use. Add the following parameter to your web.xml: cors.origin http://www.hosteddomain.com pushmode automatic true (be sure that async-support was enabled for all vaadin servlets/filters) The ''cors.origin'' parameter can be a comma separated list. Here's an example html file: Embedded Vaadin application
And the rest of our web.xml: EmbeddedUI com.sibvisions.rad.ui.vaadin.server.VaadinServlet UI com.sibvisions.rad.ui.vaadin.impl.VaadinUI widgetset com.sibvisions.rad.ui.vaadin.ext.ui.Widgetset main com.sibvisions.apps.MyEmbeddedApplication Launcher.uifactory com.sibvisions.rad.ui.vaadin.impl.VaadinFactory pushmode automatic true EmbeddedUI /* The application was configured for ROOT context of Tomcat(8). If you have a different context, simply change the URLs: browserDetailsUrl, serviceUrl and vaadinDir (see above html page). \\ **Information** There's a problem in Vaadin with push mechanism: https://dev.vaadin.com/ticket/14477 A workaround for Tomcat8, via web.xml: org.atmosphere.container.JSR356AsyncSupport.mappingPath /app/web/ui Set the parameter for the servlet, which is used multiple times, e.g.: VaadinUI /VAADIN/* VaadinUI /app/web/ui/*