I've created an issue and did a first step at the implementation at

https://issues.apache.org/jira/browse/SLING-10871

The api is based on what we have in servlet helpers today, with some fixes and minor changes. In addition I added some methods which allow to reuse parts of an existing request like the http context, the request dispatcher or the session. All optional of course.

My plan is to apply the PR to the main branch and then we can see whether we need more fine tuning additions before a first release.

Regards
Carsten

Am 29.09.2021 um 18:40 schrieb Carsten Ziegeler:
Hi,

in https://issues.apache.org/jira/browse/SLING-10840 we have some lengthy discussion about the servlet helpers bundle, where and how it should be used and the problem with it implementing ProviderType interfaces.

The gist of it, is that the main purpose of this bundle is to be used in tests. It provides mocks for several things. Due to it implementing ProviderType it is a little bit more dangerouns to use it in production as it constantly needs to be updated whenever the Sling api changes (the relevant packages have changes).

Now, as suggested in that ticket, we should probably have some proper API to create an initial request and response without backing it out or wrapping an existing request / response.

The suggestion is to provide two builder classes (similar or same) as in the servlet helpers bundle but make it more prominent. All required implementation classes would be private.

We could either move these to the API bundle, where the interfaces are defined. Or to the Engine bundle which contains the processor interface which is probably the most common use case for these.

I don't have any real preference, API is probably the better location as this is general purpose functionality which can be used without the processor.

WDYT?


Regards
Carsten

--
Carsten Ziegeler
Adobe
cziege...@apache.org

Reply via email to