Skip to content

Provide an optional controller for serving static assets #315

Description

@erdlet

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 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions