Does anyone have an example of how to launch Vaadin 10+ in an embedded Jetty? There are hundreds of examples around to do this using a Maven plugin (mvn jetty:run) but what I’m looking for is a snippet to successfully launch using a plain old Java main method.
So far, I’m able to launch Jetty with a VaadinServlet but it seems that Route annotations are not located and static resources cannot be found. Can anyone help?
Server server = new Server(8080);
ServletContextHandler handler = new ServletContextHandler(ServletContextHandler.SESSIONS);
handler.addServlet(VaadinServlet.class, "/*");
server.setHandler(handler);
server.start()
Well Spring (+Boot) is out of the question because my team started the project years ago on Guice so it was not practical to migrate.
The embedded Jetty route, launched via code, is exactly what I have for Vaadin 8 and works just fine but with the newer Flow based Vaadin(s), though there isn’t much guidance around about how to start it manually without the automatic help of Spring or Maven.
Now the snippet I posted was sufficient for older Vaadins but with the current version, @Route("") annotation scanning and various other bits of automation isn’t really documented properly which is why I’m asking for help in this area to help run up a normal non-Spring application.