Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-11850

HTL: Add support for suffix manipulation in ResourceRuntimeExtension

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • Scripting HTL Engine 1.4.22-1.4.0
    • None
    • Scripting

    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"/>
      

      See also: https://github.com/apache/sling-org-apache-sling-scripting-jsp-taglib/blob/7835da79f1de7c9c14fd478e9fec23f54fd6d711/src/main/java/org/apache/sling/scripting/jsp/taglib/AbstractDispatcherTagHandler.java#L89

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            robin.brouns@amplexor.com Robin Brouns
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: