You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 :)
The text was updated successfully, but these errors were encountered:
I think a resource like this can be really helpful for "Jakarta MVC only" applications to get static assets provided by the MVC implementation. This way we could also provide helper methods via MvcContext so CSS may be accessed by ${mvc.css}/foobar.css.
After testing this a little bit I found a few topics that need investigation:
How to solve subdirectories? At the moment, the PoC can't handle paths like /js/foobar/somescript.js
GlassFish seems to have a different resolving mechanism for WEB-INF/ files than e. g. WildFly. Maybe there is a better place for the static resources than WEB-INF/.
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 status404
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'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 :)
The text was updated successfully, but these errors were encountered: