I have a web-fragment containing swagger-ui used by many web projects (WARs).
The static content of the swagger-ui resides in META-INF/resources
. Some of the web projects only provide a REST-API and have no own UI.
For this kind of projects the web-fragment works, because the static content is served under ${CONTEXT-ROOT}/*
.
But for projects with a custom UI served under ${CONTEXT-ROOT}/*
I do not know how to serve the swagger-ui for example under ${CONTEXT-ROOT}/api/*
.
Is there any possibility to change where static content of a web-fragment is served in the main web project?
It is not really a solution, rather a workaround. In the parent web.xml I can remap the servlet name of the web-fragment like this: