Embedded Jetty/Tomcat with latest vaadin (18.x)

I found examples for vaadin 14, but if I replace the vaadin version with 18.x, it does not work. Can one of the experts provide the details and insight on the glue code moving pieces between these frameworks, in hope that these details be a point of reference with future release.

Hi, could you please provide a bit more details on what you are trying to achieve and what you have tried so far? Generally speaking, version 18.x works at least with Spring Boot and its embedded Tomcat (perhaps even with an embedded Jetty, though I’m frankly not sure about that).

Tried this https://github.com/alejandro-du/embedded-jetty-demo. I don’t want to use spring boot or any other dependency injection frameworks.

Well, it’s worth noting that v.18 endpoints depend on Spring Boot auto-configuration (at least for now). So those shouldn’t work in a non-Spring-Boot project

Are you saying that v18 only works with Spring Boot…? That’s a bit limitation. I couldn’t find any reference to that in the docs. Seems that “start” projects allows java only.

Are you saying that v18 only works with Spring Boot…?

No, I didn’t mean that. v18 requires Spring Boot only if you intend to create UIs in TypeScript and connect those to the backend through endpoints written in Java (this is the crux of the so-called Fusion model that comes with v.15+). If you are not creating UIs in TypeScript, however, then you can continue to use plain Java.

In any case, I’m still not sure in what way is embedding Jetty/Tomcat not working for you in v.18. But I know of no reason that it shouldn’t work.

Can you provide an sample project code?

Adjusting this project for Vaadin 18 seems to be working: https://github.com/mvysny/vaadin14-embedded-jetty

In this project (and other than bumping the Vaadin version in pom.xml) you’ll need to remove this line: https://github.com/mvysny/vaadin14-embedded-jetty/blob/e921d00c27e0c11d620123d46f533b98611806f5/src/main/java/com/vaadin/starter/skeleton/MainView.java#L14