Hi Robert, > On 26 Sep 2019, at 13:08, Robert Munteanu <romb...@apache.org> wrote: > > > My solution has two steps: > > 1. wrap the original request using a SlingHttpServletRequestWrapper and > overriding getResource() to return the new resource. Also overriding > getRequestPathInfo to return an object that points to the new resource > > 2. obtain a reference to the DefaultGetServlet via > > @Reference(target = > "(component.name=org.apache.sling.servlets.get.DefaultGetServlet)") > private Servlet getServlet; > > (I guess I could use the component pid as a slight improvement). > > and invoke its service() method with the altered request and the same > response. >
Why can’t you use the RequestDispatcher in the second step instead of directly referencing the DefaultGetServlet? Cheers, Radu