The first step in migrating from JSF or JSP based solutions to a single-page web app with Vaadin is commonly to integrate some views of your existing app to a Vaadin based app. Integrating Vaadin to existing JSF and JSP-based (such as Struts, Stripes, or Turbine) applications just got easier. I recently published two add-ons to facilitate the integration of Vaadin UIs into JSP and JSF views. In short, the add-ons implement tags that you can directly use in JSP or XHTML files:
The url attribute tells the add-on where to find the VaadinServlet serving your Vaadin UI. It’s also possible to specify the theme and the widgetset to use:
<vaadin:ui url="/myui" widgetset="com.example.MyUiWidgetset" theme="mytheme"/>
Was it difficult to implement these add-ons? Yes, I had to do some extensive research about… Not! It wasn’t. Implementing this kind of integration is actually easy. And the technique is well documented in the Vaadin documentation.
After a while developing web applications with Vaadin, you might get to the point where you are thinking mostly about Java classes, design patterns, reusability, refactoring, and Object Oriented concepts in general. This is due to the fact that Vaadin abstracts away complex web technologies that you have previously needed with JSF and JSP, so you no longer need to frequently think about these technologies.
Having said that, understanding the very basics of how “the magic” happens is worth knowing, and if you are curious about how this kind of integration can be implemented, you can take a look at this example application or even better, watch this webinar.
I wrote “the magic” in the previous paragraph because in the end it’s just something carefully crafted by, in this case, a team of developers doing the hard work. So, let others do the hard work and use Vaadin for the rest.
Which other technologies do you think should have this kind of integration? Let us know in the comments section.