Details
Description
In JSP there is the possibility to include a resource in a component and adjust the suffix of the sub-request, processing this resource:
<sling:include path="my-component" resourceType="application/components/other-component" replaceSuffix="some-suffix"/>
But HTL lacks this option to adjust the suffix for the sub-request (by using data-sly-resource): see https://github.com/apache/sling-org-apache-sling-scripting-sightly/blob/3b50f91c4f600081f0585e50dfb775c4b2856b89/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/ResourceRuntimeExtension.java#L58
Is there a reason why this feature wasn't added and is not supported right now?
Because we can manipulate the suffix in a URI context in HTL (https://github.com/apache/sling-org-apache-sling-scripting-sightly/blob/3b50f91c4f600081f0585e50dfb775c4b2856b89/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/URIManipulationFilterExtension.java#L221), but just not in the Resource context.
The RequestDispatcher is already available and used in the ResourceRuntimeExtension so it could be added.