Problem
At the moment it is not possible to use a more complex Jakarta REST application, used by an Jakarta MVC application, on the context root. The main problem is that any static resources, like e. g. src/main/webapp/static/css/style.css, would be served by the Servlet container starting from the context root of the application, which is already handled by the Jakarta REST application. As a result, a HTTP response with status 404 is sent.
Idea
To avoid this situation and enable Jakarta MVC applications to be deployed on the context root, Krazo could provide an optional StaticAssetController which serves the necessary files. In a first step, the served files could be set up in a fixed directory structure, e. g. WEB-INF/static/[css,js,...] and served by this new Controller. The MIME types of the files are handled by the type mapping provided by the Servlet Container or the application's web.xml.
PoC
I'll add a PoC within the next days as a basis for discussion.
Would be happy to get some feedback from @eclipse-ee4j/ee4j-krazo-committers :)
Problem
At the moment it is not possible to use a more complex Jakarta REST application, used by an Jakarta MVC application, on the context root. The main problem is that any static resources, like e. g.
src/main/webapp/static/css/style.css, would be served by the Servlet container starting from the context root of the application, which is already handled by the Jakarta REST application. As a result, a HTTP response with status404is sent.Idea
To avoid this situation and enable Jakarta MVC applications to be deployed on the context root, Krazo could provide an optional
StaticAssetControllerwhich serves the necessary files. In a first step, the served files could be set up in a fixed directory structure, e. g.WEB-INF/static/[css,js,...]and served by this new Controller. The MIME types of the files are handled by the type mapping provided by the Servlet Container or the application'sweb.xml.PoC
I'll add a PoC within the next days as a basis for discussion.
Would be happy to get some feedback from @eclipse-ee4j/ee4j-krazo-committers :)