eclipse-ee4j / eclipse-ee4j/jersey

Ability to run as Filter that ignores unhandled requests

Open
#2,723 4 comments 0 reactions 0 assignees View on GitHub
Component: core Priority: Major Type: New Feature
Dominant language
Java
Stars
730
Forks
382
PR merge metrics
No merged PRs in 30d

Description

Please add a new feature alongside FEATURE_FILTER_FORWARD_ON_404 that would behave as follows:

When Jersey is configured to run as a filter, it should not modify the ServletResponse unless the request matches a registered resource class/method. If a match occurs, the ServletResponse should contain what the class/method returned, but otherwise the ServletResponse should get passed (unmodified) to the next filter in the chain.

This differs from FEATURE_FILTER_FORWARD_ON_404/FILTER_FORWARD_ON_404 in that the latter:

1. Passes control to the next filter in the chain if a registered resource returns 404
2. Modifies the response code before passing ServletResponse to the next filter in the chain

The proposed feature would not do any of this.

I can't use PROPERTY_WEB_PAGE_CONTENT_REGEX/FILTER_STATIC_CONTENT_REGEX because I don't know ahead of time what URL will match subsequent filter(s). I wish to map all filters to the same context path and have them delegate to the next filter if they can't handle the request themselves.

Please add this feature to both Jersey 1 and 2\. I can file a duplicate feature request for separate versions if you wish.
#### Affected Versions
[2.7]

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.