eclipse-ee4j / eclipse-ee4j/krazo

Provide an optional controller for serving static assets

Open
#315 3 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
55
Forks
25
Avg merge
3h 25m
Merged PRs (30d)
3

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.