Open denis-anisimov opened 5 years ago
See also #4797
We need servlet auto-registration for https://github.com/vaadin/flow/issues/5125.
This should be a custom OSGi specific servlet rather than plain VaadinServlet
.
We should not auto-register the servlet in case the application contains a custom servlet.
At the moment developer should care himself about
VaadinServlet
registration for his OSGi bundle.There are several ways to do it:
Web-ContextPath
manifest headerThe first way has been used in original OSGi tests for
jetty-osgi-boot
as a web server container within Apache Felix. See https://github.com/vaadin/flow/blob/7314427ae8c40104e627f6a2a4e41cb4ff121f74/flow-tests/test-root-context/bnd.bnd#L8But once I changed the web container from
jetty-osgi-boot
tofelix-jetty
this way doesn't work anymore: the container recognizes a bundle as a WAB it says that the context root is occupied ( by the wayfelix-jetty
doesn't allow to use"/"
as a context root for a custom WAB) but web servlets are not instantiated and nothing works. I don't know whether this is something specific forfelix-jetty
or may be I missed something additionally or additional config is required. It's possible to register a servlet programmatically though either viaHttpService
or via Http Whiteboard specification.This is done as a modern way of OSGi tests in Flow.
But
frontend
servlet in the same way as we do in plain servlet container.