New to Vaadin: basic question

I’ve been developing with Struts (old 1.x version) and have other JSP experience and some Thymeleaf.

I’m reading through the “Book” and it looks very much like Vaadin web apps are more like Swing apps. So far I haven’t seen any point at which you create an XHTML file to represent your application. Are the UIs all developed within the code itself? I thought I had seen references to Vaadin tags, but I’ve yet to see any mention in the Book (maybe I haven’t gotten far enough). Wait, just found the “Embedding UIs in Web Pages” section.

Any clarification on this as I continue reading would be appreciated.

Thanks.

Les

Hi Les,

It depends on what you want to do. Indeed, the traditional way of writing Vaadin apps requires you to write not a single line of HTML by hand; Vaadin generates a “bootstrap” HTML page itself and loads the required JavaScript code to build the UI programmatically, via DOM manipulation, based on what your server-side Java code tells it to do.

You can indeed also write a “framing” page by hand, including some JavaScript that allows Vaadin to bootstrap itself inside the div element you point it to. In that case you have a full control over the enclosing document, but Vaadin still completely handles the rendering of the application inside the div.

Starting from Vaadin 7.4.0, we additionally support a “declarative” HTML-like syntax for describing application UIs. Still, this is only HTML-like and will be interpreted on the server side to build the application the same way as if you had written the Java code by hand. In the future we might extend this to actually generate HTML on the server side to make application startup faster.

Hi Johannes,

Thanks for the reply. So if I need to include header and footer pages, I would need to write the framing page? The same for specifying CSS links?

What is the best way to deal with custom JSP tags that have been written for the Struts application? Is their a Vaadin-like way to handle that?

Les