Mashups using Vaadin?


Many thanks for answering my last post! I gave the tutorial application a whirl and have a few comments/questions about it:

  1. From the standpoint of folks like me who are just trying Vaadin out, I think it would be nice if one could download the Vaadin tutorial as one ZIP file, and if the web app code in such a ZIP file came complete with a Maven POM file too. I think this would really help developers get a quick first taste of Vaadin better.

  2. Examining the web.xml file in the tutorial, I saw that one needs to declare an ApplicationServlet there. This servlet just forwards all requests over to the SimpleAddressBook class, where the entire UI for the rendered page is built up using Java code. This got me wondering. Ideally (and maybe my vision is wrong), I would want to define most my web app’s UI in ‘normal’ HTML/JSP/Freemarker templates, and just insert a few Vaadin components (like ASP UI components) here and there on each page – maybe in iframes, and then maybe have these components instantiate themselves using AJAX postbacks to some Vaadin backend servlet(s)/things. This would leave me a lot of freedom as far as designing the remaining, non-Vaadin-widget content of the pages (in straightforward HTML/JSP), and it would also let the webapp easily process other, non-Vaadin requests (which I would maybe route through Spring MVC). Is this model at all feasible? Or, to break the question down into subparts:

a) Are such non-Vaadin-centric mashups at all possible with the framework?

b) Can multiple Vaadin mashup components on a single page communicate with each other, as well as with non-Vaadin components?

c) How do I (best) / can I at all integrate Vaadin with other MVC frameworks? Do I just make that other framework forward certain (and only some) HTTP requests to the Vaadin ApplicationServlet/Application class and let it process all other requests differently? Or do I map Vaadin, say, to only .do requests already in web.xml? Does Vaadin need to intercept all incoming HTTP requests in the web app?

d) Do I need to have a single Vaadin Application class through which all Vaadin-related calls would pass?

e) The SimpleAddressBook tutorial uses only one ‘widget’ – the table (Note: I’m not very sure ‘widget’ is the right term here). What if I have hundreds of widgets (tables) in my web app? Do I still have only one ApplicationServlet in the app? Or do I need to declare a servlet for each and every such mashup widget? If not, what thing will I need to declare a single instance of for each and every widget?

Note: I’m not sure I’m still thinking along your framework’s paradigm – please correct me if I’m wrong!

  1. I also think it would be nice to post answers to this kind of questions somewhere on your site or make them easier to find…

  2. It would be equally great if you could also let folks play around with a more sophisticated sample application – which would obviously answer a lot of these noob questions! :slight_smile:

Looking forward to your answer! Apologies in advance for my horrible verbosity :slight_smile:



Vaadin is itself a ajax rich application framework. It’s applications are all single page and all UI changes are happening without any URL or JSP/etc page reloads. So basically you cannot integrate separate Vaadin components with other MVC frameworks, you’d better rather create entire application using VAADIN.

However, you may write a smaller applications (however, complete applications, not just controls) and insert it into html pages , generated by other frameworks, using iframe or div elements.

Hope this clarifies your thoughts.


Thanks so much for the reply, Dimitri!

Unfortunately, what you say makes Vaadin sound like quite a straightjacket. I can’t use other MVC packages with it and I’m being forced to code my presentation logic in Java, not HTML/JSP. (Yes, I’ve heard of the experimental Vaadin WYSIWYG editor, but it is experimental and a straightjacket – compared to writing normal HTML – as well…)

Hmm, I’ll probably need to take a closer look at the other, more JS-centric, GWT derivatives – unless one of the Vaadin engineers can suggest more flexible ways of using their framework, more along the lines of what I talked about…

Thanks, all!


Sorry to hear Vaadin doesn’t quite suit your needs. I’ll just add that Vaadin is primarily designed for full-blown web app development, not for adding individual widgets to a web page (although that’s doable as well).

Have you looked at our
CustomLayout component
? Might be what you need to keep purely presentational issues in HTML (you can get JSP working with it, too, but why on earth would you want to use JSP ;-)).

I have been also looking kind of “Reference application” done with Vaadin that answers some questions doing “real” application. In the meanwhile I made my own but it’s quite simple. You can check it out from