embed app & ad hoc styling


I have a small Vaadin app which is simply a form with some special logic/pop-ups when submit is hit.

The idea is other people can embed the application in their own webpages + some attributes (to identify who they are). So I have 2 questions really

  1. Say the simple application is hosted on abc.com:8888/myform. Someone now wants to embed the application in their own webpage with the identifier “1”, so the thing to embed would be abc.com:8888/myform?id=1 … what’s the best way to do that (ok, that’s not really a Vaadin question, sorry).
  2. Is there a way to apply css for a would-be-embedder so that the application looks like part of his own site, rather than something that just got plonked in?


  1. You can use that exact URL type, and get the parameter in UI.init with request.getParameter(“id”).

  2. It depends. in most cases, the embedder has their own style, that you don’t have control over, correct? in which case it would be very difficult to make a customizeable theme that automatically works. What you can do, is build your own theme so that the embedded can override the values he or she wants to. You do this by making a clear styles CSS file, and apply lots of comments :slight_smile: Note that this will only work when embedding in a DIV, not an IFrame.